summaryrefslogtreecommitdiffstats
path: root/tests/ui/intrinsics
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/ui/intrinsics
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.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-backtrace-std.run.stderr3
-rw-r--r--tests/ui/intrinsics/const-eval-select-backtrace.run.stderr3
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs17
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr (renamed from tests/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr)10
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-padding.rs10
5 files changed, 29 insertions, 14 deletions
diff --git a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr
index 463cd52c5..a0024c092 100644
--- a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr
+++ b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr
@@ -1,2 +1,3 @@
-thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:6:6
+thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:8:
+byte index 1 is out of bounds of ``
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr
index 54e28db5e..3f196bd8a 100644
--- a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr
+++ b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr
@@ -1,2 +1,3 @@
-thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:17:9
+thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:17:9:
+Aaah!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
new file mode 100644
index 000000000..0e894ef58
--- /dev/null
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
@@ -0,0 +1,17 @@
+#![feature(core_intrinsics)]
+#![feature(const_intrinsic_raw_eq)]
+
+const RAW_EQ_PADDING: bool = unsafe {
+ std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
+//~^ ERROR evaluation of constant value failed
+//~| requires initialized memory
+};
+
+const RAW_EQ_PTR: bool = unsafe {
+ std::intrinsics::raw_eq(&(&0), &(&1))
+//~^ ERROR evaluation of constant value failed
+//~| `raw_eq` on bytes with provenance
+};
+
+pub fn main() {
+}
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
index 56d5a4857..4fc304cda 100644
--- a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
@@ -1,9 +1,15 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/intrinsic-raw_eq-const-padding.rs:5:5
+ --> $DIR/intrinsic-raw_eq-const-bad.rs:5:5
|
LL | std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at alloc3[0x0..0x4], but memory is uninitialized at [0x1..0x2], and this operation requires initialized memory
-error: aborting due to previous error
+error[E0080]: evaluation of constant value failed
+ --> $DIR/intrinsic-raw_eq-const-bad.rs:11:5
+ |
+LL | std::intrinsics::raw_eq(&(&0), &(&1))
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `raw_eq` on bytes with provenance
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.rs b/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.rs
deleted file mode 100644
index a93d777d2..000000000
--- a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#![feature(core_intrinsics)]
-#![feature(const_intrinsic_raw_eq)]
-
-const BAD_RAW_EQ_CALL: bool = unsafe {
- std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
-//~^ ERROR evaluation of constant value failed
-};
-
-pub fn main() {
-}