diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-03-07 15:07:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-07 15:07:09 +0100 |
| commit | bb582c6d0f36207ed46f1bce8554d714b28980b1 (patch) | |
| tree | 8d25e38dee2a30f3a6b202bdd8e133dd5730c72d /compiler/rustc_trait_selection/src | |
| parent | 9bda4e47c7f12c0aaadfc7bc12cc486c4e456418 (diff) | |
| parent | 850cc34da2ec86ae5b84e48a03d6b451b1dcd4d7 (diff) | |
| download | rust-bb582c6d0f36207ed46f1bce8554d714b28980b1.tar.gz rust-bb582c6d0f36207ed46f1bce8554d714b28980b1.zip | |
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
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/util.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs index 6e01e0b76aa..3f433a9e919 100644 --- a/compiler/rustc_trait_selection/src/traits/util.rs +++ b/compiler/rustc_trait_selection/src/traits/util.rs @@ -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)| { |
