2021-02-13 01:53:28 -06:00
|
|
|
error[E0412]: cannot find type `N` in this scope
|
2021-08-27 11:04:57 -05:00
|
|
|
--> $DIR/invalid-const-arguments.rs:5:16
|
2021-02-13 01:53:28 -06:00
|
|
|
|
|
|
|
|
LL | struct A<const N: u8>;
|
|
|
|
| ---------------------- similarly named struct `A` defined here
|
|
|
|
LL | trait Foo {}
|
|
|
|
LL | impl Foo for A<N> {}
|
2021-05-05 11:59:37 -05:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
help: a struct with a similar name exists
|
|
|
|
|
|
|
|
|
LL | impl Foo for A<A> {}
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~
|
2021-05-05 11:59:37 -05:00
|
|
|
help: you might be missing a type parameter
|
|
|
|
|
|
|
|
|
LL | impl<N> Foo for A<N> {}
|
2021-06-21 21:07:19 -05:00
|
|
|
| +++
|
2021-02-13 01:53:28 -06:00
|
|
|
|
2021-02-13 22:35:18 -06:00
|
|
|
error[E0412]: cannot find type `T` in this scope
|
2021-08-27 11:04:57 -05:00
|
|
|
--> $DIR/invalid-const-arguments.rs:14:32
|
2021-02-13 22:35:18 -06:00
|
|
|
|
|
|
|
|
LL | struct A<const N: u8>;
|
|
|
|
| ---------------------- similarly named struct `A` defined here
|
|
|
|
...
|
|
|
|
LL | impl<const N: u8> Foo for C<N, T> {}
|
2021-05-05 11:59:37 -05:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
help: a struct with a similar name exists
|
|
|
|
|
|
|
|
|
LL | impl<const N: u8> Foo for C<N, A> {}
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~
|
2021-05-05 11:59:37 -05:00
|
|
|
help: you might be missing a type parameter
|
|
|
|
|
|
2021-05-06 07:33:23 -05:00
|
|
|
LL | impl<const N: u8, T> Foo for C<N, T> {}
|
2021-06-21 21:07:19 -05:00
|
|
|
| +++
|
2021-02-13 22:35:18 -06:00
|
|
|
|
|
|
|
error[E0747]: unresolved item provided when a constant was expected
|
2021-08-27 11:04:57 -05:00
|
|
|
--> $DIR/invalid-const-arguments.rs:5:16
|
2021-02-13 01:53:28 -06:00
|
|
|
|
|
|
|
|
LL | impl Foo for A<N> {}
|
|
|
|
| ^
|
2021-02-13 22:35:18 -06:00
|
|
|
|
|
|
|
|
help: if this generic argument was intended as a const parameter, surround it with braces
|
|
|
|
|
|
|
|
|
LL | impl Foo for A<{ N }> {}
|
2021-06-21 21:07:19 -05:00
|
|
|
| + +
|
2021-02-13 01:53:28 -06:00
|
|
|
|
|
|
|
error[E0747]: type provided when a constant was expected
|
2021-08-27 11:04:57 -05:00
|
|
|
--> $DIR/invalid-const-arguments.rs:10:19
|
2021-02-13 01:53:28 -06:00
|
|
|
|
|
|
|
|
LL | impl<N> Foo for B<N> {}
|
2023-02-20 05:01:44 -06:00
|
|
|
| - ^
|
|
|
|
| |
|
|
|
|
| help: consider changing this type parameter to a const parameter: `const N: u8`
|
2021-02-13 22:35:18 -06:00
|
|
|
|
|
|
|
error[E0747]: unresolved item provided when a constant was expected
|
2021-08-27 11:04:57 -05:00
|
|
|
--> $DIR/invalid-const-arguments.rs:14:32
|
2021-02-13 22:35:18 -06:00
|
|
|
|
|
|
|
|
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-06-21 21:07:19 -05:00
|
|
|
| + +
|
2021-02-13 01:53:28 -06:00
|
|
|
|
2021-02-13 22:35:18 -06:00
|
|
|
error: aborting due to 5 previous errors
|
2021-02-13 01:53:28 -06:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0412, E0747.
|
|
|
|
For more information about an error, try `rustc --explain E0412`.
|