Rollup merge of #122123 - compiler-errors:object-trait-alias-bounds, r=oli-obk
Don't require specifying unrelated assoc types when trait alias is in `dyn` type Object types must specify the associated types for all of the principal trait ref's supertraits. However, we weren't doing elaboration properly, so we incorrectly errored with erroneous suggestions to specify associated types that were unrelated to that principal trait ref. To fix this, use proper supertrait elaboration when expanding trait aliases in `conv_object_ty_poly_trait_ref`. **NOTE**: Please use the ignore-whitespace option when reviewing. This only touches a handful of lines. r? oli-obk or please feel free to reassign. Fixes #122118
This commit is contained in:
commit
bb582c6d0f
4 changed files with 55 additions and 50 deletions
|
@ -127,7 +127,7 @@ impl<'tcx> TraitAliasExpander<'tcx> {
|
|||
}
|
||||
|
||||
// Get components of trait alias.
|
||||
let predicates = tcx.implied_predicates_of(trait_ref.def_id());
|
||||
let predicates = tcx.super_predicates_of(trait_ref.def_id());
|
||||
debug!(?predicates);
|
||||
|
||||
let items = predicates.predicates.iter().rev().filter_map(|(pred, span)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue