]> git.lizzy.rs Git - rust.git/blob - src/test/ui/keyword/keyword-self-as-type-param.stderr
Rollup merge of #95376 - WaffleLapkin:drain_keep_rest, r=dtolnay
[rust.git] / src / test / ui / keyword / keyword-self-as-type-param.stderr
1 error: unexpected keyword `Self` in generic parameters
2   --> $DIR/keyword-self-as-type-param.rs:3:12
3    |
4 LL | struct Foo<Self>(Self);
5    |            ^^^^
6    |
7    = note: you cannot use `Self` as a generic parameter because it is reserved for associated items
8
9 error: unexpected keyword `Self` in generic parameters
10   --> $DIR/keyword-self-as-type-param.rs:7:11
11    |
12 LL | trait Bar<Self> {}
13    |           ^^^^
14    |
15    = note: you cannot use `Self` as a generic parameter because it is reserved for associated items
16
17 error[E0072]: recursive type `Foo` has infinite size
18   --> $DIR/keyword-self-as-type-param.rs:3:1
19    |
20 LL | struct Foo<Self>(Self);
21    | ^^^^^^^^^^^^^^^^ ---- recursive without indirection
22    | |
23    | recursive type has infinite size
24    |
25 help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
26    |
27 LL | struct Foo<Self>(Box<Self>);
28    |                  ++++    +
29
30 error: aborting due to 3 previous errors
31
32 For more information about this error, try `rustc --explain E0072`.