File: const-eval-select-bad.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 893,176 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (105 lines) | stat: -rw-r--r-- 4,107 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
error: this argument must be a function item
  --> $DIR/const-eval-select-bad.rs:7:27
   |
LL |     const_eval_select((), || {}, || {});
   |                           ^^^^^
   |
   = note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:27: 7:29}
   = help: consult the documentation on `const_eval_select` for more information

error: this argument must be a function item
  --> $DIR/const-eval-select-bad.rs:7:34
   |
LL |     const_eval_select((), || {}, || {});
   |                                  ^^^^^
   |
   = note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:34: 7:36}
   = help: consult the documentation on `const_eval_select` for more information

error[E0277]: expected a `FnOnce()` closure, found `{integer}`
  --> $DIR/const-eval-select-bad.rs:10:27
   |
LL |     const_eval_select((), 42, 0xDEADBEEF);
   |     -----------------     ^^ expected an `FnOnce()` closure, found `{integer}`
   |     |
   |     required by a bound introduced by this call
   |
   = help: the trait `FnOnce()` is not implemented for `{integer}`
   = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `const_eval_select`
  --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL

error[E0277]: expected a `FnOnce()` closure, found `{integer}`
  --> $DIR/const-eval-select-bad.rs:10:31
   |
LL |     const_eval_select((), 42, 0xDEADBEEF);
   |     -----------------         ^^^^^^^^^^ expected an `FnOnce()` closure, found `{integer}`
   |     |
   |     required by a bound introduced by this call
   |
   = help: the trait `FnOnce()` is not implemented for `{integer}`
   = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `const_eval_select`
  --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL

error: this argument must be a function item
  --> $DIR/const-eval-select-bad.rs:10:27
   |
LL |     const_eval_select((), 42, 0xDEADBEEF);
   |                           ^^
   |
   = note: expected a function item, found {integer}
   = help: consult the documentation on `const_eval_select` for more information

error: this argument must be a function item
  --> $DIR/const-eval-select-bad.rs:10:31
   |
LL |     const_eval_select((), 42, 0xDEADBEEF);
   |                               ^^^^^^^^^^
   |
   = note: expected a function item, found {integer}
   = help: consult the documentation on `const_eval_select` for more information

error[E0271]: expected `bar` to be a fn item that returns `i32`, but it returns `bool`
  --> $DIR/const-eval-select-bad.rs:32:34
   |
LL |     const_eval_select((1,), foo, bar);
   |     -----------------            ^^^ expected `i32`, found `bool`
   |     |
   |     required by a bound introduced by this call
   |
note: required by a bound in `const_eval_select`
  --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL

error[E0631]: type mismatch in function arguments
  --> $DIR/const-eval-select-bad.rs:37:32
   |
LL | const fn foo(n: i32) -> i32 {
   | --------------------------- found signature defined here
...
LL |     const_eval_select((true,), foo, baz);
   |     -----------------          ^^^ expected due to this
   |     |
   |     required by a bound introduced by this call
   |
   = note: expected function signature `fn(bool) -> _`
              found function signature `fn(i32) -> _`
note: required by a bound in `const_eval_select`
  --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
help: consider wrapping the function in a closure
   |
LL |     const_eval_select((true,), |arg0: bool| foo(/* i32 */), baz);
   |                                ++++++++++++    +++++++++++

error: this argument must be a `const fn`
  --> $DIR/const-eval-select-bad.rs:42:29
   |
LL |     const_eval_select((1,), bar, bar);
   |                             ^^^
   |
   = help: consult the documentation on `const_eval_select` for more information

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0271, E0277, E0631.
For more information about an error, try `rustc --explain E0271`.