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