1
Fork 0

Prefer retain over hand-rolling an inefficient version of it

This commit is contained in:
Oli Scherer 2023-06-16 15:05:39 +00:00
parent 25e3785b86
commit 243687a37c

View file

@ -235,13 +235,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
}
for def_ids in associated_types.values_mut() {
for def_id in def_ids.clone() {
// If the associated type has a `where Self: Sized` bound, we do not need to constrain the associated
// type in the `dyn Trait`.
if tcx.generics_require_sized_self(def_id) {
def_ids.remove(&def_id);
}
}
def_ids.retain(|def_id| !tcx.generics_require_sized_self(def_id));
}
self.complain_about_missing_associated_types(