Skip to content

Commit bdd8992

Browse files
committed
Start working on builtin traits in chalk
1 parent c7bd2bf commit bdd8992

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

chalk-integration/src/lowering.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,7 @@ impl LowerTrait for TraitDefn {
12411241
binders: binders,
12421242
flags: self.flags.lower(),
12431243
associated_ty_ids,
1244+
well_known: None,
12441245
})
12451246
}
12461247
}

chalk-rust-ir/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub struct StructFlags {
8787
}
8888

8989
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
90+
/// JRL What does a TraitDatum represent?
9091
pub struct TraitDatum<I: Interner> {
9192
pub id: TraitId<I>,
9293

@@ -99,6 +100,13 @@ pub struct TraitDatum<I: Interner> {
99100

100101
/// The id of each associated type defined in the trait.
101102
pub associated_ty_ids: Vec<AssocTypeId<I>>,
103+
104+
pub well_known: Option<WellKnownTrait>,
105+
}
106+
107+
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
108+
pub enum WellKnownTrait {
109+
SizedTrait,
102110
}
103111

104112
impl<I: Interner> TraitDatum<I> {
@@ -130,8 +138,11 @@ pub struct TraitDatumBound<I: Interner> {
130138
pub struct TraitFlags {
131139
pub auto: bool,
132140
pub marker: bool,
141+
/// JRL What does upstream trait mean?
133142
pub upstream: bool,
143+
/// JRL What fundamental traits are there? Does this just mean #[fundamental] like `Box`?
134144
pub fundamental: bool,
145+
/// JRL Also what are these?
135146
pub non_enumerable: bool,
136147
pub coinductive: bool,
137148
}

chalk-solve/src/clauses.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rustc_hash::FxHashSet;
1212
pub mod builder;
1313
mod env_elaborator;
1414
pub mod program_clauses;
15+
mod builtin_traits;
1516

1617
/// For auto-traits, we generate a default rule for every struct,
1718
/// unless there is a manual impl for that struct given explicitly.

chalk-solve/src/clauses/builtin_traits.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)