]> git.lizzy.rs Git - rust.git/blob - src/test/ui/intrinsics/const-eval-select-bad.stderr
Permit `#[deprecated]` in stdlib
[rust.git] / src / test / ui / intrinsics / const-eval-select-bad.stderr
1 error[E0277]: the trait bound `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]: ~const FnOnce<()>` is not satisfied
2   --> $DIR/const-eval-select-bad.rs:6:27
3    |
4 LL |     const_eval_select((), || {}, || {});
5    |     -----------------     ^^^^^ expected an `FnOnce<()>` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`
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:6:27: 6:32]`
10 note: the trait `FnOnce<()>` is implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`, but that implementation is not `const`
11   --> $DIR/const-eval-select-bad.rs:6:27
12    |
13 LL |     const_eval_select((), || {}, || {});
14    |                           ^^^^^
15    = note: wrap the `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]` 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}: ~const FnOnce<()>` is not satisfied
23   --> $DIR/const-eval-select-bad.rs:8: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:8: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 Drop,
52    |        ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
53
54 error[E0271]: type mismatch resolving `<fn(i32) -> bool {bar} as FnOnce<(i32,)>>::Output == i32`
55   --> $DIR/const-eval-select-bad.rs:28: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 Drop,
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:33:32
68    |
69 LL | const fn foo(n: i32) -> i32 {
70    | --------------------------- found signature of `fn(i32) -> _`
71 ...
72 LL |     const_eval_select((true,), foo, baz);
73    |     -----------------          ^^^ expected signature of `fn(bool) -> _`
74    |     |
75    |     required by a bound introduced by this call
76    |
77 note: required by a bound in `const_eval_select`
78   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
79    |
80 LL |     F: ~const FnOnce<ARG, Output = RET>,
81    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
82
83 error: aborting due to 5 previous errors
84
85 Some errors have detailed explanations: E0271, E0277, E0631.
86 For more information about an error, try `rustc --explain E0271`.