We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
retain
1 parent 25e3785 commit 243687aCopy full SHA for 243687a
compiler/rustc_hir_analysis/src/astconv/object_safety.rs
@@ -235,13 +235,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
235
}
236
237
for def_ids in associated_types.values_mut() {
238
- for def_id in def_ids.clone() {
239
- // If the associated type has a `where Self: Sized` bound, we do not need to constrain the associated
240
- // type in the `dyn Trait`.
241
- if tcx.generics_require_sized_self(def_id) {
242
- def_ids.remove(&def_id);
243
- }
244
+ // If the associated type has a `where Self: Sized` bound, we do not need to constrain the associated
+ // type in the `dyn Trait`.
+ def_ids.retain(|def_id| !tcx.generics_require_sized_self(def_id));
245
246
247
self.complain_about_missing_associated_types(
0 commit comments