summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/early/invalid-const-arguments.stderr
blob: b46e7e24f4921e4ca9e0d0c9b847d896621eb79f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
error[E0412]: cannot find type `N` in this scope
  --> $DIR/invalid-const-arguments.rs:5:16
   |
LL | struct A<const N: u8>;
   | ---------------------- similarly named struct `A` defined here
LL | trait Foo {}
LL | impl Foo for A<N> {}
   |                ^
   |
help: a struct with a similar name exists
   |
LL | impl Foo for A<A> {}
   |                ~
help: you might be missing a type parameter
   |
LL | impl<N> Foo for A<N> {}
   |     +++

error[E0412]: cannot find type `T` in this scope
  --> $DIR/invalid-const-arguments.rs:14:32
   |
LL | struct A<const N: u8>;
   | ---------------------- similarly named struct `A` defined here
...
LL | impl<const N: u8> Foo for C<N, T> {}
   |                                ^
   |
help: a struct with a similar name exists
   |
LL | impl<const N: u8> Foo for C<N, A> {}
   |                                ~
help: you might be missing a type parameter
   |
LL | impl<const N: u8, T> Foo for C<N, T> {}
   |                 +++

error[E0747]: unresolved item provided when a constant was expected
  --> $DIR/invalid-const-arguments.rs:5:16
   |
LL | impl Foo for A<N> {}
   |                ^
   |
help: if this generic argument was intended as a const parameter, surround it with braces
   |
LL | impl Foo for A<{ N }> {}
   |                +   +

error[E0747]: type provided when a constant was expected
  --> $DIR/invalid-const-arguments.rs:10:19
   |
LL | impl<N> Foo for B<N> {}
   |                   ^
   |
help: consider changing this type parameter to be a `const` generic
   |
LL | impl<const N: u8> Foo for B<N> {}
   |      ~~~~~~~~~~~

error[E0747]: unresolved item provided when a constant was expected
  --> $DIR/invalid-const-arguments.rs:14:32
   |
LL | impl<const N: u8> Foo for C<N, T> {}
   |                                ^
   |
help: if this generic argument was intended as a const parameter, surround it with braces
   |
LL | impl<const N: u8> Foo for C<N, { T }> {}
   |                                +   +

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0412, E0747.
For more information about an error, try `rustc --explain E0412`.