Don't require associated types with Self: Sized
bounds in dyn Trait
objects
This commit is contained in:
parent
9227ff28af
commit
ca581f9161
5 changed files with 23 additions and 14 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue