summaryrefslogtreecommitdiffstats
path: root/tests/ui/intrinsics/const-eval-select-bad.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /tests/ui/intrinsics/const-eval-select-bad.stderr
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/intrinsics/const-eval-select-bad.stderr')
-rw-r--r--tests/ui/intrinsics/const-eval-select-bad.stderr36
1 files changed, 20 insertions, 16 deletions
diff --git a/tests/ui/intrinsics/const-eval-select-bad.stderr b/tests/ui/intrinsics/const-eval-select-bad.stderr
index e6ff9d5a0..85e22178c 100644
--- a/tests/ui/intrinsics/const-eval-select-bad.stderr
+++ b/tests/ui/intrinsics/const-eval-select-bad.stderr
@@ -16,20 +16,24 @@ 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: this argument must be a function item
+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
|
- = note: expected a function item, found {integer}
- = help: consult the documentation on `const_eval_select` for more information
+ = 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.rs:LL:COL
error[E0277]: expected a `FnOnce()` closure, found `{integer}`
- --> $DIR/const-eval-select-bad.rs:10:27
+ --> $DIR/const-eval-select-bad.rs:10:31
|
LL | const_eval_select((), 42, 0xDEADBEEF);
- | ----------------- ^^ expected an `FnOnce()` closure, found `{integer}`
+ | ----------------- ^^^^^^^^^^ expected an `FnOnce()` closure, found `{integer}`
| |
| required by a bound introduced by this call
|
@@ -39,26 +43,22 @@ note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
error: this argument must be a function item
- --> $DIR/const-eval-select-bad.rs:10:31
+ --> $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[E0277]: expected a `FnOnce()` closure, found `{integer}`
+error: this argument must be a function item
--> $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.rs:LL:COL
+ = 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
@@ -86,6 +86,10 @@ LL | const_eval_select((true,), foo, baz);
found function signature `fn(i32) -> _`
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.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