|
1 | 1 | warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
|
2 | 2 | --> $DIR/fn-const-param-infer.rs:1:12
|
3 | 3 | |
|
4 |
| -LL | #![feature(const_generics, const_compare_raw_pointers)] |
| 4 | +LL | #![feature(const_generics)] |
5 | 5 | | ^^^^^^^^^^^^^^
|
6 | 6 | |
|
7 | 7 | = note: `#[warn(incomplete_features)]` on by default
|
8 | 8 | = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
|
9 | 9 |
|
10 |
| -error[E0308]: mismatched types |
11 |
| - --> $DIR/fn-const-param-infer.rs:16:31 |
| 10 | +error: using function pointers as const generic parameters is forbidden |
| 11 | + --> $DIR/fn-const-param-infer.rs:4:25 |
12 | 12 | |
|
13 |
| -LL | let _: Checked<not_one> = Checked::<not_two>; |
14 |
| - | ^^^^^^^^^^^^^^^^^^ expected `{not_one as fn(usize) -> bool}`, found `{not_two as fn(usize) -> bool}` |
15 |
| - | |
16 |
| - = note: expected type `{not_one as fn(usize) -> bool}` |
17 |
| - found type `{not_two as fn(usize) -> bool}` |
18 |
| - |
19 |
| -error[E0308]: mismatched types |
20 |
| - --> $DIR/fn-const-param-infer.rs:20:24 |
21 |
| - | |
22 |
| -LL | let _ = Checked::<{generic_arg::<u32>}>; |
23 |
| - | ^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32` |
24 |
| - | |
25 |
| - = note: expected fn pointer `fn(usize) -> _` |
26 |
| - found fn item `fn(u32) -> _ {generic_arg::<u32>}` |
27 |
| - |
28 |
| -error[E0282]: type annotations needed |
29 |
| - --> $DIR/fn-const-param-infer.rs:22:23 |
30 |
| - | |
31 |
| -LL | let _ = Checked::<generic>; |
32 |
| - | ^^^^^^^ cannot infer type for type parameter `T` declared on the function `generic` |
33 |
| - |
34 |
| -error[E0308]: mismatched types |
35 |
| - --> $DIR/fn-const-param-infer.rs:25:40 |
36 |
| - | |
37 |
| -LL | let _: Checked<{generic::<u32>}> = Checked::<{generic::<u16>}>; |
38 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{generic::<u32> as fn(usize) -> bool}`, found `{generic::<u16> as fn(usize) -> bool}` |
39 |
| - | |
40 |
| - = note: expected type `{generic::<u32> as fn(usize) -> bool}` |
41 |
| - found type `{generic::<u16> as fn(usize) -> bool}` |
| 13 | +LL | struct Checked<const F: fn(usize) -> bool>; |
| 14 | + | ^^^^^^^^^^^^^^^^^ |
42 | 15 |
|
43 |
| -error: aborting due to 4 previous errors; 1 warning emitted |
| 16 | +error: aborting due to previous error; 1 warning emitted |
44 | 17 |
|
45 |
| -Some errors have detailed explanations: E0282, E0308. |
46 |
| -For more information about an error, try `rustc --explain E0282`. |
0 commit comments