1
- error: this argument must be a function item
1
+ error[E0277]: the trait bound `{closure@$DIR/const-eval-select-bad.rs:7:27: 7:29}: const FnOnce()` is not satisfied
2
2
--> $DIR/const-eval-select-bad.rs:7:27
3
3
|
4
4
LL | const_eval_select((), || {}, || {});
5
- | ^^^^^
6
- |
7
- = note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:27: 7:29}
8
- = help: consult the documentation on `const_eval_select` for more information
9
-
10
- error: this argument must be a function item
11
- --> $DIR/const-eval-select-bad.rs:7:34
12
- |
13
- LL | const_eval_select((), || {}, || {});
14
- | ^^^^^
5
+ | ----------------- ^^^^^
6
+ | |
7
+ | required by a bound introduced by this call
15
8
|
16
- = note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:34: 7:36}
17
- = help: consult the documentation on `const_eval_select` for more information
9
+ note: required by a bound in `const_eval_select`
10
+ --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
18
11
19
12
error[E0277]: expected a `FnOnce()` closure, found `{integer}`
20
- --> $DIR/const-eval-select-bad.rs:10 :27
13
+ --> $DIR/const-eval-select-bad.rs:9 :27
21
14
|
22
15
LL | const_eval_select((), 42, 0xDEADBEEF);
23
16
| ----------------- ^^ expected an `FnOnce()` closure, found `{integer}`
@@ -30,7 +23,7 @@ note: required by a bound in `const_eval_select`
30
23
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
31
24
32
25
error[E0277]: expected a `FnOnce()` closure, found `{integer}`
33
- --> $DIR/const-eval-select-bad.rs:10 :31
26
+ --> $DIR/const-eval-select-bad.rs:9 :31
34
27
|
35
28
LL | const_eval_select((), 42, 0xDEADBEEF);
36
29
| ----------------- ^^^^^^^^^^ expected an `FnOnce()` closure, found `{integer}`
@@ -42,26 +35,8 @@ LL | const_eval_select((), 42, 0xDEADBEEF);
42
35
note: required by a bound in `const_eval_select`
43
36
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
44
37
45
- error: this argument must be a function item
46
- --> $DIR/const-eval-select-bad.rs:10:27
47
- |
48
- LL | const_eval_select((), 42, 0xDEADBEEF);
49
- | ^^
50
- |
51
- = note: expected a function item, found {integer}
52
- = help: consult the documentation on `const_eval_select` for more information
53
-
54
- error: this argument must be a function item
55
- --> $DIR/const-eval-select-bad.rs:10:31
56
- |
57
- LL | const_eval_select((), 42, 0xDEADBEEF);
58
- | ^^^^^^^^^^
59
- |
60
- = note: expected a function item, found {integer}
61
- = help: consult the documentation on `const_eval_select` for more information
62
-
63
38
error[E0271]: expected `bar` to return `i32`, but it returns `bool`
64
- --> $DIR/const-eval-select-bad.rs:32 :34
39
+ --> $DIR/const-eval-select-bad.rs:29 :34
65
40
|
66
41
LL | const_eval_select((1,), foo, bar);
67
42
| ----------------- ^^^ expected `i32`, found `bool`
@@ -72,7 +47,7 @@ note: required by a bound in `const_eval_select`
72
47
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
73
48
74
49
error[E0631]: type mismatch in function arguments
75
- --> $DIR/const-eval-select-bad.rs:37 :32
50
+ --> $DIR/const-eval-select-bad.rs:34 :32
76
51
|
77
52
LL | const fn foo(n: i32) -> i32 {
78
53
| --------------------------- found signature defined here
@@ -91,15 +66,18 @@ help: consider wrapping the function in a closure
91
66
LL | const_eval_select((true,), |arg0: bool| foo(/* i32 */), baz);
92
67
| ++++++++++++ +++++++++++
93
68
94
- error: this argument must be a ` const fn`
95
- --> $DIR/const-eval-select-bad.rs:42 :29
69
+ error[E0277]: the trait bound `fn(i32) -> bool {bar}: const FnOnce(i32)` is not satisfied
70
+ --> $DIR/const-eval-select-bad.rs:39 :29
96
71
|
97
72
LL | const_eval_select((1,), bar, bar);
98
- | ^^^
73
+ | ----------------- ^^^
74
+ | |
75
+ | required by a bound introduced by this call
99
76
|
100
- = help: consult the documentation on `const_eval_select` for more information
77
+ note: required by a bound in `const_eval_select`
78
+ --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
101
79
102
- error: aborting due to 9 previous errors
80
+ error: aborting due to 6 previous errors
103
81
104
82
Some errors have detailed explanations: E0271, E0277, E0631.
105
83
For more information about an error, try `rustc --explain E0271`.
0 commit comments