Only use a single loop over the associated types
This commit is contained in:
parent
243687a37c
commit
3219993fa8
1 changed files with 2 additions and 5 deletions
|
@ -219,8 +219,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
// So every `Projection` clause is an `Assoc = Foo` bound. `associated_types` contains all associated
|
// So every `Projection` clause is an `Assoc = Foo` bound. `associated_types` contains all associated
|
||||||
// types's `DefId`, so the following loop removes all the `DefIds` of the associated types that have a
|
// types's `DefId`, so the following loop removes all the `DefIds` of the associated types that have a
|
||||||
// corresponding `Projection` clause
|
// corresponding `Projection` clause
|
||||||
for (projection_bound, span) in &projection_bounds {
|
for def_ids in associated_types.values_mut() {
|
||||||
for def_ids in associated_types.values_mut() {
|
for (projection_bound, span) in &projection_bounds {
|
||||||
let def_id = projection_bound.projection_def_id();
|
let def_id = projection_bound.projection_def_id();
|
||||||
def_ids.remove(&def_id);
|
def_ids.remove(&def_id);
|
||||||
if tcx.generics_require_sized_self(def_id) {
|
if tcx.generics_require_sized_self(def_id) {
|
||||||
|
@ -232,9 +232,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for def_ids in associated_types.values_mut() {
|
|
||||||
// If the associated type has a `where Self: Sized` bound, we do not need to constrain the associated
|
// If the associated type has a `where Self: Sized` bound, we do not need to constrain the associated
|
||||||
// type in the `dyn Trait`.
|
// type in the `dyn Trait`.
|
||||||
def_ids.retain(|def_id| !tcx.generics_require_sized_self(def_id));
|
def_ids.retain(|def_id| !tcx.generics_require_sized_self(def_id));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue