rust/tests/ui/traits/alias/generic-default-in-dyn.stderr
2025-01-26 21:20:31 +01:00

44 lines
1.9 KiB
Text

error[E0658]: trait aliases are experimental
--> $DIR/generic-default-in-dyn.rs:1:1
|
LL | trait SendEqAlias<T> = PartialEq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #41517 <https://github.com/rust-lang/rust/issues/41517> for more information
= help: add `#![feature(trait_alias)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0038]: the trait alias `SendEqAlias` is not dyn compatible
--> $DIR/generic-default-in-dyn.rs:4:19
|
LL | struct Foo<T>(dyn SendEqAlias<T>);
| ^^^^^^^^^^^^^^ `SendEqAlias` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/generic-default-in-dyn.rs:1:24
|
LL | trait SendEqAlias<T> = PartialEq;
| ----------- ^^^^^^^^^ ...because it uses `Self` as a type parameter
| |
| this trait is not dyn compatible...
error[E0038]: the trait alias `SendEqAlias` is not dyn compatible
--> $DIR/generic-default-in-dyn.rs:7:19
|
LL | struct Bar<T>(dyn SendEqAlias<T>, T);
| ^^^^^^^^^^^^^^ `SendEqAlias` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/generic-default-in-dyn.rs:1:24
|
LL | trait SendEqAlias<T> = PartialEq;
| ----------- ^^^^^^^^^ ...because it uses `Self` as a type parameter
| |
| this trait is not dyn compatible...
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0038, E0658.
For more information about an error, try `rustc --explain E0038`.