Skip to content

Commit fba5977

Browse files
committed
filter before interning
1 parent 50cc7ff commit fba5977

2 files changed

Lines changed: 162 additions & 41 deletions

File tree

‎compiler/rustc_next_trait_solver/src/solve/trait_goals.rs‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,7 @@ where
157157
.caller_bounds()
158158
.trait_clauses(ecx.cx())
159159
.with_polarity(goal.predicate.polarity)
160-
// .for_trait(goal.predicate.def_id())
161-
// TODO: allow filtering before interning
162-
.interned()
163-
.iter()
164-
.filter(move |&trait_clause| {
165-
let trait_clause = trait_clause
166-
.as_trait_clause()
167-
.expect("caller_bounds only returns trait clauses");
168-
160+
.filter(move |trait_clause| {
169161
trait_def_id_matches(
170162
ecx.cx(),
171163
trait_clause.def_id(),
@@ -176,6 +168,10 @@ where
176168
trait_clause.skip_binder().trait_ref.args,
177169
)
178170
})
171+
// TODO: allow using for_trait by elaborating the sized hierarchy
172+
// .for_trait(goal.predicate.def_id())
173+
.interned()
174+
.iter()
179175
}
180176

181177
fn fast_reject_assumption(

0 commit comments

Comments
 (0)