]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/issue-103790.stderr
Rollup merge of #106951 - tmiasko:rm-simplify-initial, r=oli-obk
[rust.git] / tests / ui / consts / issue-103790.stderr
1 error[E0403]: the name `S` is already used for a generic parameter in this item's generic parameters
2   --> $DIR/issue-103790.rs:4:29
3    |
4 LL | struct S<const S: (), const S: S = { S }>;
5    |                -            ^ already used
6    |                |
7    |                first use of `S`
8
9 error[E0107]: missing generics for struct `S`
10   --> $DIR/issue-103790.rs:4:32
11    |
12 LL | struct S<const S: (), const S: S = { S }>;
13    |                                ^ expected at least 1 generic argument
14    |
15 note: struct defined here, with at least 1 generic parameter: `S`
16   --> $DIR/issue-103790.rs:4:8
17    |
18 LL | struct S<const S: (), const S: S = { S }>;
19    |        ^ -----------
20 help: add missing generic argument
21    |
22 LL | struct S<const S: (), const S: S<S> = { S }>;
23    |                                 +++
24
25 error[E0391]: cycle detected when computing type of `S::S`
26   --> $DIR/issue-103790.rs:4:32
27    |
28 LL | struct S<const S: (), const S: S = { S }>;
29    |                                ^
30    |
31    = note: ...which immediately requires computing type of `S::S` again
32 note: cycle used when computing type of `S`
33   --> $DIR/issue-103790.rs:4:1
34    |
35 LL | struct S<const S: (), const S: S = { S }>;
36    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37
38 error[E0391]: cycle detected when computing type of `S`
39   --> $DIR/issue-103790.rs:4:1
40    |
41 LL | struct S<const S: (), const S: S = { S }>;
42    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43    |
44 note: ...which requires computing type of `S::S`...
45   --> $DIR/issue-103790.rs:4:32
46    |
47 LL | struct S<const S: (), const S: S = { S }>;
48    |                                ^
49    = note: ...which again requires computing type of `S`, completing the cycle
50 note: cycle used when collecting item types in top-level module
51   --> $DIR/issue-103790.rs:1:1
52    |
53 LL | / #![feature(generic_const_exprs)]
54 LL | | #![allow(incomplete_features)]
55 LL | |
56 LL | | struct S<const S: (), const S: S = { S }>;
57 ...  |
58 LL | |
59 LL | | fn main() {}
60    | |____________^
61
62 error: aborting due to 4 previous errors
63
64 Some errors have detailed explanations: E0107, E0391, E0403.
65 For more information about an error, try `rustc --explain E0107`.