@@ -30,26 +30,62 @@ LL | impl<T, const A: u8 = 2> X<T> {}
30
30
| ^
31
31
help: you might be missing a type parameter
32
32
|
33
- LL | impl<T, const A, N: u8 = 2> X<N> {}
34
- | ^^^
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:14: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:14: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
+ | ^^^
35
71
36
72
error[E0412]: cannot find type `A` in this scope
37
- --> $DIR/missing-type-parameter2.rs:14 :24
73
+ --> $DIR/missing-type-parameter2.rs:18 :24
38
74
|
39
75
LL | struct X<const N: u8>();
40
76
| ------------------------ similarly named struct `X` defined here
41
77
...
42
- LL | fn bar<const N: u8>(a : A) {}
78
+ LL | fn bar<const N: u8>(_ : A) {}
43
79
| ^
44
80
|
45
81
help: a struct with a similar name exists
46
82
|
47
- LL | fn bar<const N: u8>(a : X) {}
83
+ LL | fn bar<const N: u8>(_ : X) {}
48
84
| ^
49
85
help: you might be missing a type parameter
50
86
|
51
- LL | fn bar<const N, A : u8>(a : A) {}
52
- | ^^^
87
+ LL | fn bar<const N: u8, A>(_ : A) {}
88
+ | ^^^
53
89
54
90
error[E0747]: unresolved item provided when a constant was expected
55
91
--> $DIR/missing-type-parameter2.rs:6:8
@@ -79,7 +115,7 @@ help: if this generic argument was intended as a const parameter, surround it wi
79
115
LL | impl<T, const A: u8 = 2> X<{ N }> {}
80
116
| ^ ^
81
117
82
- error: aborting due to 6 previous errors
118
+ error: aborting due to 8 previous errors
83
119
84
120
Some errors have detailed explanations: E0412, E0747.
85
121
For more information about an error, try `rustc --explain E0412`.
0 commit comments