rust/tests/ui/const-generics/generic_const_exprs/dyn-compatibility-ok-infer-err.stderr
2026-02-11 18:08:18 +09:00

19 lines
708 B
Text

error[E0284]: type annotations needed
--> $DIR/dyn-compatibility-ok-infer-err.rs:19:5
|
LL | use_dyn(&());
| ^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `use_dyn`
|
note: required by a const generic parameter in `use_dyn`
--> $DIR/dyn-compatibility-ok-infer-err.rs:14:12
|
LL | fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
| ^^^^^^^^^^^^^^ required by this const generic parameter in `use_dyn`
help: consider specifying the generic argument
|
LL | use_dyn::<N>(&());
| +++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0284`.