2022-08-22 19:07:26 -05:00
|
|
|
error: this argument must be a function item
|
2022-04-11 20:12:26 -05:00
|
|
|
--> $DIR/const-eval-select-bad.rs:7:27
|
|
|
|
|
|
|
|
|
LL | const_eval_select((), || {}, || {});
|
2022-08-22 19:07:26 -05:00
|
|
|
| ^^^^^
|
2022-04-11 20:12:26 -05:00
|
|
|
|
|
2023-09-09 01:36:50 -05:00
|
|
|
= note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:27: 7:29}
|
2022-08-22 19:07:26 -05:00
|
|
|
= help: consult the documentation on `const_eval_select` for more information
|
|
|
|
|
|
|
|
error: this argument must be a function item
|
|
|
|
--> $DIR/const-eval-select-bad.rs:7:34
|
2022-04-11 20:12:26 -05:00
|
|
|
|
|
|
|
|
LL | const_eval_select((), || {}, || {});
|
2022-08-22 19:07:26 -05:00
|
|
|
| ^^^^^
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
2023-09-09 01:36:50 -05:00
|
|
|
= note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:34: 7:36}
|
2022-08-22 19:07:26 -05:00
|
|
|
= help: consult the documentation on `const_eval_select` for more information
|
2021-10-12 00:06:37 -05:00
|
|
|
|
2023-12-16 13:20:00 -06:00
|
|
|
error[E0277]: expected a `FnOnce()` closure, found `{integer}`
|
2022-08-22 19:07:26 -05:00
|
|
|
--> $DIR/const-eval-select-bad.rs:10:27
|
|
|
|
|
|
|
|
|
LL | const_eval_select((), 42, 0xDEADBEEF);
|
2023-12-16 13:20:00 -06:00
|
|
|
| ----------------- ^^ expected an `FnOnce()` closure, found `{integer}`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2022-08-22 19:07:26 -05:00
|
|
|
|
|
2023-12-16 13:20:00 -06:00
|
|
|
= help: the trait `FnOnce<()>` is not implemented for `{integer}`
|
|
|
|
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
|
|
|
|
note: required by a bound in `const_eval_select`
|
|
|
|
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
2022-08-22 19:07:26 -05:00
|
|
|
|
2023-10-04 20:50:00 -05:00
|
|
|
error[E0277]: expected a `FnOnce()` closure, found `{integer}`
|
2023-12-16 13:20:00 -06:00
|
|
|
--> $DIR/const-eval-select-bad.rs:10:31
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
|
LL | const_eval_select((), 42, 0xDEADBEEF);
|
2023-12-16 13:20:00 -06:00
|
|
|
| ----------------- ^^^^^^^^^^ expected an `FnOnce()` closure, found `{integer}`
|
2021-10-12 00:06:37 -05:00
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
|
|
|
|
|
2022-08-22 19:07:26 -05:00
|
|
|
= help: the trait `FnOnce<()>` is not implemented for `{integer}`
|
2021-10-14 01:18:53 -05:00
|
|
|
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
|
2021-10-12 00:06:37 -05:00
|
|
|
note: required by a bound in `const_eval_select`
|
|
|
|
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
2022-08-22 19:07:26 -05:00
|
|
|
|
|
|
|
error: this argument must be a function item
|
2023-12-16 13:20:00 -06:00
|
|
|
--> $DIR/const-eval-select-bad.rs:10:27
|
2022-08-22 19:07:26 -05:00
|
|
|
|
|
|
|
|
LL | const_eval_select((), 42, 0xDEADBEEF);
|
2023-12-16 13:20:00 -06:00
|
|
|
| ^^
|
2022-08-22 19:07:26 -05:00
|
|
|
|
|
|
|
|
= note: expected a function item, found {integer}
|
|
|
|
= help: consult the documentation on `const_eval_select` for more information
|
2021-10-12 00:06:37 -05:00
|
|
|
|
2023-12-16 13:20:00 -06:00
|
|
|
error: this argument must be a function item
|
2022-08-22 19:07:26 -05:00
|
|
|
--> $DIR/const-eval-select-bad.rs:10:31
|
2021-10-22 15:49:12 -05:00
|
|
|
|
|
|
|
|
LL | const_eval_select((), 42, 0xDEADBEEF);
|
2023-12-16 13:20:00 -06:00
|
|
|
| ^^^^^^^^^^
|
2021-10-22 15:49:12 -05:00
|
|
|
|
|
2023-12-16 13:20:00 -06:00
|
|
|
= note: expected a function item, found {integer}
|
|
|
|
= help: consult the documentation on `const_eval_select` for more information
|
2021-10-22 15:49:12 -05:00
|
|
|
|
2023-01-06 14:28:46 -06:00
|
|
|
error[E0271]: expected `bar` to be a fn item that returns `i32`, but it returns `bool`
|
2022-08-22 19:07:26 -05:00
|
|
|
--> $DIR/const-eval-select-bad.rs:32:34
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
|
LL | const_eval_select((1,), foo, bar);
|
2022-08-13 02:09:08 -05:00
|
|
|
| ----------------- ^^^ expected `i32`, found `bool`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
|
note: required by a bound in `const_eval_select`
|
|
|
|
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
|
|
|
|
|
|
|
error[E0631]: type mismatch in function arguments
|
2022-08-22 19:07:26 -05:00
|
|
|
--> $DIR/const-eval-select-bad.rs:37:32
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
2021-10-14 01:18:53 -05:00
|
|
|
LL | const fn foo(n: i32) -> i32 {
|
2022-07-28 10:33:10 -05:00
|
|
|
| --------------------------- found signature defined here
|
2021-10-12 00:06:37 -05:00
|
|
|
...
|
|
|
|
LL | const_eval_select((true,), foo, baz);
|
2022-07-28 10:33:10 -05:00
|
|
|
| ----------------- ^^^ expected due to this
|
2021-10-12 00:06:37 -05:00
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
|
|
|
|
|
2022-07-28 10:33:10 -05:00
|
|
|
= note: expected function signature `fn(bool) -> _`
|
|
|
|
found function signature `fn(i32) -> _`
|
2021-10-12 00:06:37 -05:00
|
|
|
note: required by a bound in `const_eval_select`
|
|
|
|
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
2023-11-10 22:32:32 -06:00
|
|
|
help: consider wrapping the function in a closure
|
|
|
|
|
|
|
|
|
LL | const_eval_select((true,), |arg0: bool| foo(/* i32 */), baz);
|
|
|
|
| ++++++++++++ +++++++++++
|
2022-08-22 19:07:26 -05:00
|
|
|
|
|
|
|
error: this argument must be a `const fn`
|
|
|
|
--> $DIR/const-eval-select-bad.rs:42:29
|
|
|
|
|
|
|
|
|
LL | const_eval_select((1,), bar, bar);
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
= help: consult the documentation on `const_eval_select` for more information
|
2021-10-12 00:06:37 -05:00
|
|
|
|
2022-08-22 19:07:26 -05:00
|
|
|
error: aborting due to 9 previous errors
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0271, E0277, E0631.
|
|
|
|
For more information about an error, try `rustc --explain E0271`.
|