rust/src/test/ui/intrinsics/const-eval-select-bad.stderr

66 lines
2.8 KiB
Plaintext
Raw Normal View History

2021-10-14 06:18:53 +00:00
error[E0277]: expected a `FnOnce<()>` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`
--> $DIR/const-eval-select-bad.rs:6:34
2021-10-12 05:06:37 +00:00
|
2021-10-14 06:18:53 +00:00
LL | const_eval_select((), || {}, || {});
| ----------------- ^^^^^ expected an `FnOnce<()>` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`
2021-10-12 05:06:37 +00:00
| |
| required by a bound introduced by this call
|
2021-10-14 06:18:53 +00:00
= help: the trait `FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`
= note: wrap the `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]` 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-14 06:18:53 +00:00
error[E0277]: expected a `FnOnce<()>` closure, found `{integer}`
2021-10-12 05:06:37 +00:00
--> $DIR/const-eval-select-bad.rs:8:31
|
LL | const_eval_select((), 42, 0xDEADBEEF);
2021-10-14 06:18:53 +00:00
| ----------------- ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `{integer}`
2021-10-12 05:06:37 +00:00
| |
| required by a bound introduced by this call
|
2021-10-14 06:18:53 +00:00
= help: the trait `FnOnce<()>` is not implemented for `{integer}`
= 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-14 06:18:53 +00:00
error[E0271]: type mismatch resolving `<fn(i32) -> bool {bar} as FnOnce<(i32,)>>::Output == i32`
2021-10-12 05:06:37 +00:00
--> $DIR/const-eval-select-bad.rs:27:5
|
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
|
2021-10-14 06:18:53 +00:00
LL | G: FnOnce<ARG, Output = RET> + ~const Drop,
| ^^^^^^^^^^^^ required by this bound in `const_eval_select`
2021-10-12 05:06:37 +00:00
error[E0631]: type mismatch in function arguments
--> $DIR/const-eval-select-bad.rs:32:37
|
2021-10-14 06:18:53 +00:00
LL | const fn foo(n: i32) -> i32 {
| --------------------------- found signature of `fn(i32) -> _`
2021-10-12 05:06:37 +00:00
...
LL | const_eval_select((true,), foo, baz);
2021-10-14 06:18:53 +00:00
| ----------------- ^^^ expected signature of `fn(bool) -> _`
2021-10-12 05:06:37 +00:00
| |
| required by a bound introduced by this call
|
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
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0271, E0277, E0631.
For more information about an error, try `rustc --explain E0271`.