1
- error[E0277]: expected a `FnOnce<((),) >` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:34 ]`
2
- --> $DIR/const-eval-select-bad.rs:6:36
1
+ error[E0277]: expected a `FnOnce<() >` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32 ]`
2
+ --> $DIR/const-eval-select-bad.rs:6:34
3
3
|
4
- LL | const_eval_select((), |() | {}, |() | {});
5
- | ----------------- ^^^^^^^ expected an `FnOnce<((),) >` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:34 ]`
4
+ LL | const_eval_select((), || {}, || {});
5
+ | ----------------- ^^^^^ expected an `FnOnce<() >` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32 ]`
6
6
| |
7
7
| required by a bound introduced by this call
8
8
|
9
- = help: the trait `FnOnce<((),)>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:34]`
9
+ = help: the trait `FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`
10
+ = note: wrap the `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]` in a closure with no arguments: `|| { /* code */ }`
10
11
note: required by a bound in `const_eval_select`
11
12
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
12
13
|
13
- LL | F: ~const FnOnce( ARG) -> RET,
14
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
14
+ LL | F: ~const FnOnce< ARG, Output = RET> ,
15
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
15
16
16
- error[E0277]: expected a `FnOnce<((), )>` closure, found `{integer}`
17
+ error[E0277]: expected a `FnOnce<()>` closure, found `{integer}`
17
18
--> $DIR/const-eval-select-bad.rs:8:31
18
19
|
19
20
LL | const_eval_select((), 42, 0xDEADBEEF);
20
- | ----------------- ^^^^^^^^^^ expected an `FnOnce<((), )>` closure, found `{integer}`
21
+ | ----------------- ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `{integer}`
21
22
| |
22
23
| required by a bound introduced by this call
23
24
|
24
- = help: the trait `FnOnce<((),)>` is not implemented for `{integer}`
25
+ = help: the trait `FnOnce<()>` is not implemented for `{integer}`
26
+ = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
25
27
note: required by a bound in `const_eval_select`
26
28
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
27
29
|
28
- LL | F: ~const FnOnce( ARG) -> RET,
29
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
30
+ LL | F: ~const FnOnce< ARG, Output = RET> ,
31
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
30
32
31
- error[E0271]: type mismatch resolving `<fn(( i32,)) -> bool {bar} as FnOnce<(( i32,) ,)>>::Output == i32`
33
+ error[E0271]: type mismatch resolving `<fn(i32) -> bool {bar} as FnOnce<(i32,)>>::Output == i32`
32
34
--> $DIR/const-eval-select-bad.rs:27:5
33
35
|
34
36
LL | const_eval_select((1,), foo, bar);
@@ -37,25 +39,25 @@ LL | const_eval_select((1,), foo, bar);
37
39
note: required by a bound in `const_eval_select`
38
40
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
39
41
|
40
- LL | G: FnOnce( ARG) -> RET + ~const Drop,
41
- | ^^^ required by this bound in `const_eval_select`
42
+ LL | G: FnOnce< ARG, Output = RET> + ~const Drop,
43
+ | ^^^^^^^^^ ^^^ required by this bound in `const_eval_select`
42
44
43
45
error[E0631]: type mismatch in function arguments
44
46
--> $DIR/const-eval-select-bad.rs:32:37
45
47
|
46
- LL | const fn foo((n,): ( i32,) ) -> i32 {
47
- | --------------------------------- found signature of `fn(( i32,) ) -> _`
48
+ LL | const fn foo(n: i32) -> i32 {
49
+ | --------------------------- found signature of `fn(i32) -> _`
48
50
...
49
51
LL | const_eval_select((true,), foo, baz);
50
- | ----------------- ^^^ expected signature of `fn(( bool,) ) -> _`
52
+ | ----------------- ^^^ expected signature of `fn(bool) -> _`
51
53
| |
52
54
| required by a bound introduced by this call
53
55
|
54
56
note: required by a bound in `const_eval_select`
55
57
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
56
58
|
57
- LL | F: ~const FnOnce( ARG) -> RET,
58
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
59
+ LL | F: ~const FnOnce< ARG, Output = RET> ,
60
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
59
61
60
62
error: aborting due to 4 previous errors
61
63
0 commit comments