]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/diagnostics.stderr
Merge commit '4c41a222ca5d1325fb4b6709395bd06e766cc042' into clippyup
[rust.git] / src / test / ui / const-generics / diagnostics.stderr
1 error[E0412]: cannot find type `N` in this scope
2   --> $DIR/diagnostics.rs:7:16
3    |
4 LL | struct A<const N: u8>;
5    | ---------------------- similarly named struct `A` defined here
6 LL | trait Foo {}
7 LL | impl Foo for A<N> {}
8    |                ^
9    |
10 help: a struct with a similar name exists
11    |
12 LL | impl Foo for A<A> {}
13    |                ^
14 help: you might be missing a type parameter
15    |
16 LL | impl<N> Foo for A<N> {}
17    |     ^^^
18
19 error[E0412]: cannot find type `T` in this scope
20   --> $DIR/diagnostics.rs:16:32
21    |
22 LL | struct A<const N: u8>;
23    | ---------------------- similarly named struct `A` defined here
24 ...
25 LL | impl<const N: u8> Foo for C<N, T> {}
26    |                                ^
27    |
28 help: a struct with a similar name exists
29    |
30 LL | impl<const N: u8> Foo for C<N, A> {}
31    |                                ^
32 help: you might be missing a type parameter
33    |
34 LL | impl<const N: u8, T> Foo for C<N, T> {}
35    |                 ^^^
36
37 error[E0747]: unresolved item provided when a constant was expected
38   --> $DIR/diagnostics.rs:7:16
39    |
40 LL | impl Foo for A<N> {}
41    |                ^
42    |
43 help: if this generic argument was intended as a const parameter, surround it with braces
44    |
45 LL | impl Foo for A<{ N }> {}
46    |                ^   ^
47
48 error[E0747]: type provided when a constant was expected
49   --> $DIR/diagnostics.rs:12:19
50    |
51 LL | impl<N> Foo for B<N> {}
52    |                   ^
53    |
54 help: consider changing this type parameter to be a `const` generic
55    |
56 LL | impl<const N: u8> Foo for B<N> {}
57    |      ^^^^^^^^^^^
58
59 error[E0747]: unresolved item provided when a constant was expected
60   --> $DIR/diagnostics.rs:16:32
61    |
62 LL | impl<const N: u8> Foo for C<N, T> {}
63    |                                ^
64    |
65 help: if this generic argument was intended as a const parameter, surround it with braces
66    |
67 LL | impl<const N: u8> Foo for C<N, { T }> {}
68    |                                ^   ^
69
70 error: aborting due to 5 previous errors
71
72 Some errors have detailed explanations: E0412, E0747.
73 For more information about an error, try `rustc --explain E0412`.