2024-06-17 08:34:26 +00:00
|
|
|
error[E0284]: type annotations needed
|
2021-08-27 18:04:57 +02:00
|
|
|
--> $DIR/cannot-infer-const-args.rs:6:5
|
2020-08-09 06:19:57 +00:00
|
|
|
|
|
|
|
|
LL | foo();
|
2022-02-14 13:25:26 +01:00
|
|
|
| ^^^ cannot infer the value of the const parameter `X` declared on the function `foo`
|
2020-10-08 22:23:01 +02:00
|
|
|
|
|
2024-06-19 08:25:58 +00:00
|
|
|
note: required by a const generic parameter in `foo`
|
2024-06-17 08:34:26 +00:00
|
|
|
--> $DIR/cannot-infer-const-args.rs:1:8
|
|
|
|
|
|
|
|
|
LL | fn foo<const X: usize>() -> usize {
|
2024-06-19 08:25:58 +00:00
|
|
|
| ^^^^^^^^^^^^^^ required by this const generic parameter in `foo`
|
2022-02-14 13:25:26 +01:00
|
|
|
help: consider specifying the generic argument
|
2020-10-08 22:23:01 +02:00
|
|
|
|
|
|
|
|
LL | foo::<X>();
|
2022-02-14 13:25:26 +01:00
|
|
|
| +++++
|
2020-08-09 06:19:57 +00:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2020-08-09 06:19:57 +00:00
|
|
|
|
2024-06-17 08:34:26 +00:00
|
|
|
For more information about this error, try `rustc --explain E0284`.
|