]> git.lizzy.rs Git - rust.git/blob - tests/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / object-safety / object-safety-supertrait-mentions-GAT.stderr
1 error[E0311]: the parameter type `Self` may not live long enough
2    |
3    = help: consider adding an explicit lifetime bound `Self: 'a`...
4    = note: ...so that the type `Self` will meet its required lifetime bounds...
5 note: ...that is required by this bound
6   --> $DIR/object-safety-supertrait-mentions-GAT.rs:6:15
7    |
8 LL |         Self: 'a;
9    |               ^^
10
11 error: associated item referring to unboxed trait object for its own trait
12   --> $DIR/object-safety-supertrait-mentions-GAT.rs:10:20
13    |
14 LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
15    |       ---------- in this trait
16 LL |     fn c(&self) -> dyn SuperTrait<T>;
17    |                    ^^^^^^^^^^^^^^^^^
18    |
19 help: you might have meant to use `Self` to refer to the implementing type
20    |
21 LL |     fn c(&self) -> Self;
22    |                    ~~~~
23
24 error[E0038]: the trait `SuperTrait` cannot be made into an object
25   --> $DIR/object-safety-supertrait-mentions-GAT.rs:10:20
26    |
27 LL |     fn c(&self) -> dyn SuperTrait<T>;
28    |                    ^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
29    |
30 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
31   --> $DIR/object-safety-supertrait-mentions-GAT.rs:4:10
32    |
33 LL |     type Gat<'a>
34    |          ^^^ ...because it contains the generic associated type `Gat`
35 ...
36 LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
37    |       ---------- this trait cannot be made into an object...
38    = help: consider moving `Gat` to another trait
39
40 error: aborting due to 3 previous errors
41
42 Some errors have detailed explanations: E0038, E0311.
43 For more information about an error, try `rustc --explain E0038`.