]> git.lizzy.rs Git - rust.git/blob - tests/ui/missing/missing-items/missing-type-parameter2.stderr
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / ui / missing / missing-items / missing-type-parameter2.stderr
1 error[E0412]: cannot find type `N` in this scope
2   --> $DIR/missing-type-parameter2.rs:3:8
3    |
4 LL | struct X<const N: u8>();
5    | ------------------------ similarly named struct `X` defined here
6 LL |
7 LL | impl X<N> {}
8    |        ^
9    |
10 help: a struct with a similar name exists
11    |
12 LL | impl X<X> {}
13    |        ~
14 help: you might be missing a type parameter
15    |
16 LL | impl<N> X<N> {}
17    |     +++
18
19 error[E0412]: cannot find type `N` in this scope
20   --> $DIR/missing-type-parameter2.rs:6:28
21    |
22 LL | impl<T, const A: u8 = 2> X<N> {}
23    |      -                     ^
24    |      |
25    |      similarly named type parameter `T` defined here
26    |
27 help: a type parameter with a similar name exists
28    |
29 LL | impl<T, const A: u8 = 2> X<T> {}
30    |                            ~
31 help: you might be missing a type parameter
32    |
33 LL | impl<T, const A: u8 = 2, N> X<N> {}
34    |                        +++
35
36 error[E0412]: cannot find type `T` in this scope
37   --> $DIR/missing-type-parameter2.rs:11:20
38    |
39 LL | struct X<const N: u8>();
40    | ------------------------ similarly named struct `X` defined here
41 ...
42 LL | fn foo(_: T) where T: Send {}
43    |                    ^
44    |
45 help: a struct with a similar name exists
46    |
47 LL | fn foo(_: T) where X: Send {}
48    |                    ~
49 help: you might be missing a type parameter
50    |
51 LL | fn foo<T>(_: T) where T: Send {}
52    |       +++
53
54 error[E0412]: cannot find type `T` in this scope
55   --> $DIR/missing-type-parameter2.rs:11:11
56    |
57 LL | struct X<const N: u8>();
58    | ------------------------ similarly named struct `X` defined here
59 ...
60 LL | fn foo(_: T) where T: Send {}
61    |           ^
62    |
63 help: a struct with a similar name exists
64    |
65 LL | fn foo(_: X) where T: Send {}
66    |           ~
67 help: you might be missing a type parameter
68    |
69 LL | fn foo<T>(_: T) where T: Send {}
70    |       +++
71
72 error[E0412]: cannot find type `A` in this scope
73   --> $DIR/missing-type-parameter2.rs:15:24
74    |
75 LL | struct X<const N: u8>();
76    | ------------------------ similarly named struct `X` defined here
77 ...
78 LL | fn bar<const N: u8>(_: A) {}
79    |                        ^
80    |
81 help: a struct with a similar name exists
82    |
83 LL | fn bar<const N: u8>(_: X) {}
84    |                        ~
85 help: you might be missing a type parameter
86    |
87 LL | fn bar<const N: u8, A>(_: A) {}
88    |                   +++
89
90 error[E0747]: unresolved item provided when a constant was expected
91   --> $DIR/missing-type-parameter2.rs:3:8
92    |
93 LL | impl X<N> {}
94    |        ^
95    |
96 help: if this generic argument was intended as a const parameter, surround it with braces
97    |
98 LL | impl X<{ N }> {}
99    |        +   +
100
101 error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
102   --> $DIR/missing-type-parameter2.rs:6:9
103    |
104 LL | impl<T, const A: u8 = 2> X<N> {}
105    |         ^^^^^^^^^^^^^^^
106
107 error[E0747]: unresolved item provided when a constant was expected
108   --> $DIR/missing-type-parameter2.rs:6:28
109    |
110 LL | impl<T, const A: u8 = 2> X<N> {}
111    |                            ^
112    |
113 help: if this generic argument was intended as a const parameter, surround it with braces
114    |
115 LL | impl<T, const A: u8 = 2> X<{ N }> {}
116    |                            +   +
117
118 error: aborting due to 8 previous errors
119
120 Some errors have detailed explanations: E0412, E0747.
121 For more information about an error, try `rustc --explain E0412`.