You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= note: `#[warn(incomplete_features)]` on by default
8
8
9
-
error[E0308]: mismatched types
10
-
--> $DIR/fn-const-param-infer.rs:16:31
9
+
error[E0741]: the types of const generic parameters must derive `PartialEq` and `Eq`
10
+
--> $DIR/fn-const-param-infer.rs:4:25
11
11
|
12
-
LL | let _: Checked<not_one> = Checked::<not_two>;
13
-
| ---------------- ^^^^^^^^^^^^^^^^^^ expected `{not_one as fn(usize) -> bool}`, found `{not_two as fn(usize) -> bool}`
14
-
| |
15
-
| expected due to this
16
-
|
17
-
= note: expected struct `Checked<{not_one as fn(usize) -> bool}>`
18
-
found struct `Checked<{not_two as fn(usize) -> bool}>`
19
-
20
-
error[E0308]: mismatched types
21
-
--> $DIR/fn-const-param-infer.rs:20:24
22
-
|
23
-
LL | let _ = Checked::<{generic_arg::<u32>}>;
24
-
| ^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`
25
-
|
26
-
= note: expected fn pointer `fn(usize) -> _`
27
-
found fn item `fn(u32) -> _ {generic_arg::<u32>}`
28
-
29
-
error[E0282]: type annotations needed
30
-
--> $DIR/fn-const-param-infer.rs:22:23
31
-
|
32
-
LL | let _ = Checked::<generic>;
33
-
| ^^^^^^^ cannot infer type for type parameter `T` declared on the function `generic`
34
-
35
-
error[E0308]: mismatched types
36
-
--> $DIR/fn-const-param-infer.rs:25:40
37
-
|
38
-
LL | let _: Checked<{generic::<u32>}> = Checked::<{generic::<u16>}>;
39
-
| ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{generic::<u32> as fn(usize) -> bool}`, found `{generic::<u16> as fn(usize) -> bool}`
40
-
| |
41
-
| expected due to this
42
-
|
43
-
= note: expected struct `Checked<{generic::<u32> as fn(usize) -> bool}>`
44
-
found struct `Checked<{generic::<u16> as fn(usize) -> bool}>`
12
+
LL | struct Checked<const F: fn(usize) -> bool>;
13
+
| ^^^^^^^^^^^^^^^^^ `fn(usize) -> bool` doesn't derive both `PartialEq` and `Eq`
45
14
46
-
error: aborting due to 4 previous errors
15
+
error: aborting due to previous error
47
16
48
-
Some errors have detailed explanations: E0282, E0308.
49
-
For more information about an error, try `rustc --explain E0282`.
17
+
For more information about this error, try `rustc --explain E0741`.
0 commit comments