2021-02-13 07:53:28 +00:00
|
|
|
error[E0412]: cannot find type `N` in this scope
|
|
|
|
--> $DIR/diagnostics.rs:7: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: `A`
|
|
|
|
|
2021-02-14 04:35:18 +00:00
|
|
|
error[E0412]: cannot find type `T` in this scope
|
|
|
|
--> $DIR/diagnostics.rs:16: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: `A`
|
|
|
|
|
|
|
|
error[E0747]: unresolved item provided when a constant was expected
|
2021-02-13 07:53:28 +00:00
|
|
|
--> $DIR/diagnostics.rs:7:16
|
|
|
|
|
|
|
|
|
LL | impl Foo for A<N> {}
|
|
|
|
| ^
|
2021-02-14 04:35:18 +00:00
|
|
|
|
|
|
|
|
help: if this generic argument was intended as a const parameter, surround it with braces
|
|
|
|
|
|
|
|
|
LL | impl Foo for A<{ N }> {}
|
|
|
|
| ^ ^
|
2021-02-13 07:53:28 +00:00
|
|
|
|
|
|
|
error[E0747]: type provided when a constant was expected
|
|
|
|
--> $DIR/diagnostics.rs:12:19
|
|
|
|
|
|
|
|
|
LL | impl<N> Foo for B<N> {}
|
2021-04-12 19:33:52 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
help: consider changing this type parameter to be a `const` generic
|
|
|
|
|
|
|
|
|
LL | impl<const N: u8> Foo for B<N> {}
|
|
|
|
| ^^^^^^^^^^^
|
2021-02-14 04:35:18 +00:00
|
|
|
|
|
|
|
error[E0747]: unresolved item provided when a constant was expected
|
|
|
|
--> $DIR/diagnostics.rs:16: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 }> {}
|
|
|
|
| ^ ^
|
2021-02-13 07:53:28 +00:00
|
|
|
|
2021-02-14 04:35:18 +00:00
|
|
|
error: aborting due to 5 previous errors
|
2021-02-13 07:53:28 +00:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0412, E0747.
|
|
|
|
For more information about an error, try `rustc --explain E0412`.
|