]> git.lizzy.rs Git - rust.git/blob - src/test/ui/keyword/keyword-self-as-type-param.stderr
Rollup merge of #102807 - aDotInTheVoid:rdj-rustup-docs, r=jyn514
[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 help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
24    |
25 LL | struct Foo<Self>(Box<Self>);
26    |                  ++++    +
27
28 error: aborting due to 3 previous errors
29
30 For more information about this error, try `rustc --explain E0072`.