]> git.lizzy.rs Git - rust.git/blob - src/test/ui/intrinsics/const-eval-select-bad.stderr
Adjust wording
[rust.git] / src / test / ui / intrinsics / const-eval-select-bad.stderr
1 error[E0277]: the trait bound `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]: FnOnce<()>` is not satisfied
2   --> $DIR/const-eval-select-bad.rs:7:27
3    |
4 LL |     const_eval_select((), || {}, || {});
5    |     -----------------     ^^^^^ expected an `FnOnce<()>` closure, found `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`
6    |     |
7    |     required by a bound introduced by this call
8    |
9    = help: the trait `~const FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`
10 note: the trait `FnOnce<()>` is implemented for `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`, but that implementation is not `const`
11   --> $DIR/const-eval-select-bad.rs:7:27
12    |
13 LL |     const_eval_select((), || {}, || {});
14    |                           ^^^^^
15    = note: wrap the `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]` in a closure with no arguments: `|| { /* code */ }`
16 note: required by a bound in `const_eval_select`
17   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
18    |
19 LL |     F: ~const FnOnce<ARG, Output = RET>,
20    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
21
22 error[E0277]: the trait bound `{integer}: FnOnce<()>` is not satisfied
23   --> $DIR/const-eval-select-bad.rs:9:27
24    |
25 LL |     const_eval_select((), 42, 0xDEADBEEF);
26    |     -----------------     ^^ expected an `FnOnce<()>` closure, found `{integer}`
27    |     |
28    |     required by a bound introduced by this call
29    |
30    = help: the trait `~const FnOnce<()>` is not implemented for `{integer}`
31    = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
32 note: required by a bound in `const_eval_select`
33   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
34    |
35 LL |     F: ~const FnOnce<ARG, Output = RET>,
36    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
37
38 error[E0277]: expected a `FnOnce<()>` closure, found `{integer}`
39   --> $DIR/const-eval-select-bad.rs:9:31
40    |
41 LL |     const_eval_select((), 42, 0xDEADBEEF);
42    |     -----------------         ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `{integer}`
43    |     |
44    |     required by a bound introduced by this call
45    |
46    = help: the trait `FnOnce<()>` is not implemented for `{integer}`
47    = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
48 note: required by a bound in `const_eval_select`
49   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
50    |
51 LL |     G: FnOnce<ARG, Output = RET> + ~const Destruct,
52    |        ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
53
54 error[E0271]: expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool`
55   --> $DIR/const-eval-select-bad.rs:29:5
56    |
57 LL |     const_eval_select((1,), foo, bar);
58    |     ^^^^^^^^^^^^^^^^^ expected `i32`, found `bool`
59    |
60 note: required by a bound in `const_eval_select`
61   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
62    |
63 LL |     G: FnOnce<ARG, Output = RET> + ~const Destruct,
64    |                    ^^^^^^^^^^^^ required by this bound in `const_eval_select`
65
66 error[E0631]: type mismatch in function arguments
67   --> $DIR/const-eval-select-bad.rs:34:32
68    |
69 LL | const fn foo(n: i32) -> i32 {
70    | --------------------------- found signature defined here
71 ...
72 LL |     const_eval_select((true,), foo, baz);
73    |     -----------------          ^^^ expected due to this
74    |     |
75    |     required by a bound introduced by this call
76    |
77    = note: expected function signature `fn(bool) -> _`
78               found function signature `fn(i32) -> _`
79 note: required by a bound in `const_eval_select`
80   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
81    |
82 LL |     F: ~const FnOnce<ARG, Output = RET>,
83    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
84
85 error: aborting due to 5 previous errors
86
87 Some errors have detailed explanations: E0271, E0277, E0631.
88 For more information about an error, try `rustc --explain E0271`.