2022-10-09 13:34:42 +00:00
|
|
|
error[E0311]: the parameter type `Self` may not live long enough
|
|
|
|
|
|
|
|
|
|
|
note: ...that is required by this bound
|
2024-10-09 23:31:01 +02:00
|
|
|
--> $DIR/supertrait-mentions-GAT.rs:6:15
|
2022-10-09 13:34:42 +00:00
|
|
|
|
|
2022-12-05 19:06:32 +00:00
|
|
|
LL | Self: 'a;
|
|
|
|
|
| ^^
|
2023-09-17 14:32:02 +00:00
|
|
|
= help: consider adding an explicit lifetime bound `Self: 'a`...
|
2022-10-09 13:34:42 +00:00
|
|
|
|
|
|
|
|
error: associated item referring to unboxed trait object for its own trait
|
2024-10-09 23:31:01 +02:00
|
|
|
--> $DIR/supertrait-mentions-GAT.rs:10:20
|
2022-10-09 13:34:42 +00:00
|
|
|
|
|
|
|
|
|
LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
|
|
|
|
|
| ---------- in this trait
|
|
|
|
|
LL | fn c(&self) -> dyn SuperTrait<T>;
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
|
help: you might have meant to use `Self` to refer to the implementing type
|
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - fn c(&self) -> dyn SuperTrait<T>;
|
|
|
|
|
LL + fn c(&self) -> Self;
|
|
|
|
|
|
|
2022-10-09 13:34:42 +00:00
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
error[E0038]: the trait `SuperTrait` is not dyn compatible
|
2024-10-09 23:31:01 +02:00
|
|
|
--> $DIR/supertrait-mentions-GAT.rs:10:20
|
2022-10-09 13:34:42 +00:00
|
|
|
|
|
|
|
|
|
LL | fn c(&self) -> dyn SuperTrait<T>;
|
2024-11-20 14:19:36 -08:00
|
|
|
| ^^^^^^^^^^^^^^^^^ `SuperTrait` is not dyn compatible
|
2022-10-09 13:34:42 +00:00
|
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 05:14:07 +01:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2024-10-09 23:31:01 +02:00
|
|
|
--> $DIR/supertrait-mentions-GAT.rs:4:10
|
2022-10-09 13:34:42 +00:00
|
|
|
|
|
|
|
|
|
LL | type Gat<'a>
|
|
|
|
|
| ^^^ ...because it contains the generic associated type `Gat`
|
|
|
|
|
...
|
|
|
|
|
LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
|
2024-11-20 14:19:36 -08:00
|
|
|
| ---------- this trait is not dyn compatible...
|
2022-10-09 13:34:42 +00:00
|
|
|
= help: consider moving `Gat` to another trait
|
|
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0038, E0311.
|
|
|
|
|
For more information about an error, try `rustc --explain E0038`.
|