Skip to content

Commit d5a8fae

Browse files
committed
Avoid enumerating traits for auto traits rules
1 parent 41121bf commit d5a8fae

File tree

4 files changed

+0
-32
lines changed

4 files changed

+0
-32
lines changed

chalk-integration/src/db.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,4 @@ impl RustIrDatabase<ChalkIr> for ChalkDatabase {
153153
fn interner(&self) -> &ChalkIr {
154154
&ChalkIr
155155
}
156-
157-
fn auto_traits(&self) -> Vec<TraitId<ChalkIr>> {
158-
self.program_ir().unwrap().auto_traits()
159-
}
160156
}

chalk-integration/src/program.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,4 @@ impl RustIrDatabase<ChalkIr> for Program {
363363
fn interner(&self) -> &ChalkIr {
364364
&ChalkIr
365365
}
366-
367-
fn auto_traits(&self) -> Vec<TraitId<ChalkIr>> {
368-
self.trait_data
369-
.iter()
370-
.filter(|(_, auto_trait)| auto_trait.is_auto_trait())
371-
.map(|(trait_id, _)| *trait_id)
372-
.collect()
373-
}
374366
}

chalk-solve/src/clauses/program_clauses.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,6 @@ impl<I: Interner> ToProgramClauses<I> for OpaqueTyDatum<I> {
176176
builder.push_fact(bound);
177177
});
178178
}
179-
180-
for auto_trait_id in builder.db.auto_traits() {
181-
// Implemented(!T<..>: AutoTrait) :- Implemented(HiddenTy: AutoTrait).
182-
builder.push_clause(
183-
TraitRef {
184-
trait_id: auto_trait_id,
185-
substitution: substitution.clone(),
186-
},
187-
iter::once(TraitRef {
188-
trait_id: auto_trait_id,
189-
substitution: Substitution::from1(
190-
interner,
191-
opaque_ty_bound.hidden_ty.clone(),
192-
),
193-
}),
194-
);
195-
}
196179
});
197180
}
198181
}

chalk-solve/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ pub trait RustIrDatabase<I: Interner>: Debug {
8888
fn well_known_trait_id(&self, well_known_trait: WellKnownTrait) -> Option<TraitId<I>>;
8989

9090
fn interner(&self) -> &I;
91-
92-
/// Returns the ids of all auto traits.
93-
fn auto_traits(&self) -> Vec<TraitId<I>>;
9491
}
9592

9693
pub use solve::Guidance;

0 commit comments

Comments
 (0)