mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-26 21:37:47 +00:00
Default sizedness bounds were not being added to `explicit_super_predicates_of` and `explicit_implied_predicates_of` which meant that a trait bound added to a associated type projection would be missing the implied predicate of the default sizedness supertrait of that trait. An unexpected consequence of this change was that the check for multiple principals was now finding an additional `MetaSized` principal when eagerly expanding trait aliases. Instead of special-casing trait aliases as different from traits and not adding a `MetaSized` supertrait to trait aliases, filter out `MetaSized` when lowering `dyn Trait`.
18 lines
868 B
Plaintext
18 lines
868 B
Plaintext
error[E0225]: only auto traits can be used as additional traits in a trait object
|
|
--> $DIR/trait-alias-elaboration.rs:11:16
|
|
|
|
|
LL | trait Qux = Clone;
|
|
| ------------------ additional non-auto trait
|
|
LL |
|
|
LL | type Foo = dyn Qux + MetaSized;
|
|
| ^^^ --------- first non-auto trait
|
|
| |
|
|
| second non-auto trait comes from this alias
|
|
|
|
|
= help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: MetaSized + MetaSized + Clone {}`
|
|
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0225`.
|