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