fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.0 KiB48 linesraw
1error[E0311]: the parameter type `Self` may not live long enough
2   |
3note: the parameter type `Self` must be valid for the lifetime `'a` as defined here...
4  --> $DIR/object-safety-supertrait-mentions-GAT.rs:9:26
5   |
6LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
7   |                          ^^
8   = help: consider adding an explicit lifetime bound `Self: 'a`...
9   = note: ...so that the type `Self` will meet its required lifetime bounds...
10note: ...that is required by this bound
11  --> $DIR/object-safety-supertrait-mentions-GAT.rs:6:15
12   |
13LL |         Self: 'a;
14   |               ^^
15
16error: associated item referring to unboxed trait object for its own trait
17  --> $DIR/object-safety-supertrait-mentions-GAT.rs:10:20
18   |
19LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
20   |       ---------- in this trait
21LL |     fn c(&self) -> dyn SuperTrait<T>;
22   |                    ^^^^^^^^^^^^^^^^^
23   |
24help: you might have meant to use `Self` to refer to the implementing type
25   |
26LL |     fn c(&self) -> Self;
27   |                    ~~~~
28
29error[E0038]: the trait `SuperTrait` cannot be made into an object
30  --> $DIR/object-safety-supertrait-mentions-GAT.rs:10:20
31   |
32LL |     fn c(&self) -> dyn SuperTrait<T>;
33   |                    ^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
34   |
35note: 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>
36  --> $DIR/object-safety-supertrait-mentions-GAT.rs:4:10
37   |
38LL |     type Gat<'a>
39   |          ^^^ ...because it contains the generic associated type `Gat`
40...
41LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
42   |       ---------- this trait cannot be made into an object...
43   = help: consider moving `Gat` to another trait
44
45error: aborting due to 3 previous errors
46
47Some errors have detailed explanations: E0038, E0311.
48For more information about an error, try `rustc --explain E0038`.