]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/defaults/default-const-param-cannot-reference-self.stderr
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
[rust.git] / tests / ui / const-generics / defaults / default-const-param-cannot-reference-self.stderr
1 error[E0735]: generic parameters cannot use `Self` in their defaults
2   --> $DIR/default-const-param-cannot-reference-self.rs:1:34
3    |
4 LL | struct Struct<const N: usize = { Self; 10 }>;
5    |                                  ^^^^ `Self` in generic parameter default
6
7 error[E0735]: generic parameters cannot use `Self` in their defaults
8   --> $DIR/default-const-param-cannot-reference-self.rs:4:30
9    |
10 LL | enum Enum<const N: usize = { Self; 10 }> { }
11    |                              ^^^^ `Self` in generic parameter default
12
13 error[E0735]: generic parameters cannot use `Self` in their defaults
14   --> $DIR/default-const-param-cannot-reference-self.rs:7:32
15    |
16 LL | union Union<const N: usize = { Self; 10 }> { not_empty: () }
17    |                                ^^^^ `Self` in generic parameter default
18
19 error: aborting due to 3 previous errors
20
21 For more information about this error, try `rustc --explain E0735`.