2020-08-09 01:19:57 -05:00
|
|
|
error: using function pointers as const generic parameters is forbidden
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/fn-const-param-infer.rs:8:25
|
2020-08-09 01:19:57 -05:00
|
|
|
|
|
|
|
|
LL | struct Checked<const F: fn(usize) -> bool>;
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
2023-09-28 15:51:48 -05:00
|
|
|
|
|
2024-09-29 15:28:11 -05:00
|
|
|
= note: the only supported types are integers, `bool`, and `char`
|
2020-08-09 01:19:57 -05:00
|
|
|
|
2024-02-09 06:17:55 -06:00
|
|
|
error[E0308]: mismatched types
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/fn-const-param-infer.rs:33:25
|
2024-02-09 06:17:55 -06:00
|
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
LL | let _ = Checked::<{ generic_arg::<u32> }>;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item
|
2024-02-09 06:17:55 -06:00
|
|
|
|
|
|
|
|
= note: expected fn pointer `fn(usize) -> _`
|
|
|
|
found fn item `fn(u32) -> _ {generic_arg::<u32>}`
|
|
|
|
|
|
|
|
error[E0282]: type annotations needed
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/fn-const-param-infer.rs:35:23
|
2024-02-09 06:17:55 -06:00
|
|
|
|
|
|
|
|
LL | let _ = Checked::<generic>;
|
|
|
|
| ^^^^^^^ cannot infer type of the type parameter `T` declared on the function `generic`
|
|
|
|
|
|
|
|
|
help: consider specifying the generic argument
|
|
|
|
|
|
|
|
|
LL | let _ = Checked::<generic::<T>>;
|
|
|
|
| +++++
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2020-08-09 01:19:57 -05:00
|
|
|
|
2024-02-09 06:17:55 -06:00
|
|
|
Some errors have detailed explanations: E0282, E0308.
|
|
|
|
For more information about an error, try `rustc --explain E0282`.
|