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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
error[E0412]: cannot find type `N` in this scope
--> $DIR/missing-type-parameter2.rs:3:8
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
LL |
LL | impl X<N> {}
| ^
|
help: a struct with a similar name exists
|
LL - impl X<N> {}
LL + impl X<X> {}
|
help: you might be missing a type parameter
|
LL | impl<N> X<N> {}
| +++
error[E0412]: cannot find type `N` in this scope
--> $DIR/missing-type-parameter2.rs:6:28
|
LL | impl<T, const A: u8 = 2> X<N> {}
| - ^
| |
| similarly named type parameter `T` defined here
|
help: a type parameter with a similar name exists
|
LL - impl<T, const A: u8 = 2> X<N> {}
LL + impl<T, const A: u8 = 2> X<T> {}
|
help: you might be missing a type parameter
|
LL | impl<T, const A: u8 = 2, N> X<N> {}
| +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:11:20
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
...
LL | fn foo(_: T) where T: Send {}
| ^
|
help: a struct with a similar name exists
|
LL - fn foo(_: T) where T: Send {}
LL + fn foo(_: T) where X: Send {}
|
help: you might be missing a type parameter
|
LL | fn foo<T>(_: T) where T: Send {}
| +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:11:11
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
...
LL | fn foo(_: T) where T: Send {}
| ^
|
help: a struct with a similar name exists
|
LL - fn foo(_: T) where T: Send {}
LL + fn foo(_: X) where T: Send {}
|
help: you might be missing a type parameter
|
LL | fn foo<T>(_: T) where T: Send {}
| +++
error[E0412]: cannot find type `A` in this scope
--> $DIR/missing-type-parameter2.rs:15:24
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
...
LL | fn bar<const N: u8>(_: A) {}
| ^
|
help: a struct with a similar name exists
|
LL - fn bar<const N: u8>(_: A) {}
LL + fn bar<const N: u8>(_: X) {}
|
help: you might be missing a type parameter
|
LL | fn bar<const N: u8, A>(_: A) {}
| +++
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/missing-type-parameter2.rs:3:8
|
LL | impl X<N> {}
| ^
|
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl X<{ N }> {}
| + +
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/missing-type-parameter2.rs:6:9
|
LL | impl<T, const A: u8 = 2> X<N> {}
| ^^^^^^^^^^^^^^^
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/missing-type-parameter2.rs:6:28
|
LL | impl<T, const A: u8 = 2> X<N> {}
| ^
|
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl<T, const A: u8 = 2> X<{ N }> {}
| + +
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0412, E0747.
For more information about an error, try `rustc --explain E0412`.
|