2024-11-20 22:19:36 +00:00
|
|
|
error[E0038]: the trait `X` is not dyn compatible
|
2024-04-23 18:52:54 +00:00
|
|
|
--> $DIR/issue-50781.rs:11:16
|
2018-05-22 15:09:35 +00:00
|
|
|
|
|
2024-04-23 18:52:54 +00:00
|
|
|
LL | impl Trait for dyn X {}
|
2024-11-20 22:19:36 +00:00
|
|
|
| ^^^^^ `X` is not dyn compatible
|
2024-04-23 18:52:54 +00:00
|
|
|
|
|
2024-11-20 22:19:36 +00:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 04:14:07 +00:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2024-04-23 18:52:54 +00:00
|
|
|
--> $DIR/issue-50781.rs:4:8
|
|
|
|
|
|
|
|
|
LL | trait X {
|
2024-11-20 22:19:36 +00:00
|
|
|
| - this trait is not dyn compatible...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | fn foo(&self) where Self: Trait;
|
2024-04-23 18:52:54 +00:00
|
|
|
| ^^^ ...because method `foo` references the `Self` type in its `where` clause
|
|
|
|
= help: consider moving `foo` to another trait
|
2024-11-20 22:19:36 +00:00
|
|
|
= help: only type `()` implements `X`; consider using it directly instead.
|
2024-04-23 18:52:54 +00:00
|
|
|
|
2024-11-20 22:19:36 +00:00
|
|
|
error[E0038]: the trait `X` is not dyn compatible
|
2024-04-23 18:52:54 +00:00
|
|
|
--> $DIR/issue-50781.rs:16:23
|
|
|
|
|
|
|
|
|
LL | <dyn X as X>::foo(&());
|
2024-11-20 22:19:36 +00:00
|
|
|
| ^^^ `X` is not dyn compatible
|
2018-05-22 15:09:35 +00:00
|
|
|
|
|
2024-11-20 22:19:36 +00:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 04:14:07 +00:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2024-04-23 18:52:54 +00:00
|
|
|
--> $DIR/issue-50781.rs:4:8
|
2020-10-16 00:23:45 +00:00
|
|
|
|
|
|
|
|
LL | trait X {
|
2024-11-20 22:19:36 +00:00
|
|
|
| - this trait is not dyn compatible...
|
2020-10-16 00:23:45 +00:00
|
|
|
LL | fn foo(&self) where Self: Trait;
|
|
|
|
| ^^^ ...because method `foo` references the `Self` type in its `where` clause
|
2020-02-01 00:47:00 +00:00
|
|
|
= help: consider moving `foo` to another trait
|
2024-11-20 22:19:36 +00:00
|
|
|
= help: only type `()` implements `X`; consider using it directly instead.
|
2024-04-23 18:52:54 +00:00
|
|
|
= note: required for the cast from `&()` to `&dyn X`
|
|
|
|
|
2024-11-20 22:19:36 +00:00
|
|
|
error[E0038]: the trait `X` is not dyn compatible
|
2024-04-23 18:52:54 +00:00
|
|
|
--> $DIR/issue-50781.rs:16:6
|
|
|
|
|
|
|
|
|
LL | <dyn X as X>::foo(&());
|
2024-11-20 22:19:36 +00:00
|
|
|
| ^^^^^ `X` is not dyn compatible
|
2022-09-18 15:55:36 +00:00
|
|
|
|
|
2024-11-20 22:19:36 +00:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 04:14:07 +00:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2024-04-23 18:52:54 +00:00
|
|
|
--> $DIR/issue-50781.rs:4:8
|
|
|
|
|
|
|
|
|
LL | trait X {
|
2024-11-20 22:19:36 +00:00
|
|
|
| - this trait is not dyn compatible...
|
2024-04-23 18:52:54 +00:00
|
|
|
LL | fn foo(&self) where Self: Trait;
|
|
|
|
| ^^^ ...because method `foo` references the `Self` type in its `where` clause
|
|
|
|
= help: consider moving `foo` to another trait
|
2024-11-20 22:19:36 +00:00
|
|
|
= help: only type `()` implements `X`; consider using it directly instead.
|
2018-05-22 15:09:35 +00:00
|
|
|
|
2024-04-23 18:52:54 +00:00
|
|
|
error: aborting due to 3 previous errors
|
2018-05-22 15:09:35 +00:00
|
|
|
|
2024-04-23 18:52:54 +00:00
|
|
|
For more information about this error, try `rustc --explain E0038`.
|