summaryrefslogtreecommitdiffstats
path: root/tests/ui/intrinsics
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
commit018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch)
treea835ebdf2088ef88fa681f8fad45f09922c1ae9a /tests/ui/intrinsics
parentAdding debian version 1.75.0+dfsg1-5. (diff)
downloadrustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz
rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/intrinsics')
-rw-r--r--tests/ui/intrinsics/const-eval-select-bad.stderr36
-rw-r--r--tests/ui/intrinsics/const-eval-select-stability.stderr2
-rw-r--r--tests/ui/intrinsics/issue-28575.mir.stderr2
-rw-r--r--tests/ui/intrinsics/issue-28575.thir.stderr2
4 files changed, 23 insertions, 19 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
diff --git a/tests/ui/intrinsics/const-eval-select-stability.stderr b/tests/ui/intrinsics/const-eval-select-stability.stderr
index 65b507b88..335b9877a 100644
--- a/tests/ui/intrinsics/const-eval-select-stability.stderr
+++ b/tests/ui/intrinsics/const-eval-select-stability.stderr
@@ -6,5 +6,5 @@ LL | const_eval_select((), nothing, log);
|
= help: const-stable functions can only call other const-stable functions
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/intrinsics/issue-28575.mir.stderr b/tests/ui/intrinsics/issue-28575.mir.stderr
index c42498390..4b29b4c1b 100644
--- a/tests/ui/intrinsics/issue-28575.mir.stderr
+++ b/tests/ui/intrinsics/issue-28575.mir.stderr
@@ -6,6 +6,6 @@ LL | FOO()
|
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/intrinsics/issue-28575.thir.stderr b/tests/ui/intrinsics/issue-28575.thir.stderr
index c42498390..4b29b4c1b 100644
--- a/tests/ui/intrinsics/issue-28575.thir.stderr
+++ b/tests/ui/intrinsics/issue-28575.thir.stderr
@@ -6,6 +6,6 @@ LL | FOO()
|
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0133`.