2022-07-14 00:28:11 +00:00
|
|
|
error[E0284]: type annotations needed
|
2024-10-09 21:31:01 +00:00
|
|
|
--> $DIR/dyn-compatibility-ok-infer-err.rs:19:5
|
2020-10-25 17:05:37 +00:00
|
|
|
|
|
|
|
|
LL | use_dyn(&());
|
2022-07-14 00:28:11 +00:00
|
|
|
| ^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `use_dyn`
|
2021-07-31 16:26:55 +00:00
|
|
|
|
|
2024-06-19 08:25:58 +00:00
|
|
|
note: required by a const generic parameter in `use_dyn`
|
2024-10-09 21:31:01 +00:00
|
|
|
--> $DIR/dyn-compatibility-ok-infer-err.rs:14:12
|
2021-07-31 16:26:55 +00:00
|
|
|
|
|
|
|
|
LL | fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
|
2024-06-19 08:25:58 +00:00
|
|
|
| ^^^^^^^^^^^^^^ required by this const generic parameter in `use_dyn`
|
2022-07-14 00:28:11 +00:00
|
|
|
help: consider specifying the generic argument
|
|
|
|
|
|
|
|
|
LL | use_dyn::<N>(&());
|
|
|
|
| +++++
|
2020-10-25 17:05:37 +00:00
|
|
|
|
2024-06-17 08:34:26 +00:00
|
|
|
error[E0284]: type annotations needed
|
2024-10-09 21:31:01 +00:00
|
|
|
--> $DIR/dyn-compatibility-ok-infer-err.rs:19:5
|
2024-06-17 08:34:26 +00:00
|
|
|
|
|
|
|
|
LL | use_dyn(&());
|
|
|
|
| ^^^^^^^ --- type must be known at this point
|
|
|
|
| |
|
|
|
|
| cannot infer the value of the const parameter `N` declared on the function `use_dyn`
|
|
|
|
|
|
|
|
|
note: required for `()` to implement `Foo<_>`
|
2024-10-09 21:31:01 +00:00
|
|
|
--> $DIR/dyn-compatibility-ok-infer-err.rs:8:22
|
2024-06-17 08:34:26 +00:00
|
|
|
|
|
|
|
|
LL | impl<const N: usize> Foo<N> for () {
|
|
|
|
| -------------- ^^^^^^ ^^
|
|
|
|
| |
|
|
|
|
| unsatisfied trait bound introduced here
|
|
|
|
= note: required for the cast from `&()` to `&dyn Foo<_>`
|
|
|
|
help: consider specifying the generic argument
|
|
|
|
|
|
|
|
|
LL | use_dyn::<N>(&());
|
|
|
|
| +++++
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2020-10-25 17:05:37 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0284`.
|