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