Don't require associated types with Self: Sized bounds in dyn Trait objects
This commit is contained in:
@@ -1131,6 +1131,16 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.complain_about_missing_associated_types(
|
||||
associated_types,
|
||||
potential_assoc_types,
|
||||
|
||||
Reference in New Issue
Block a user