summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/raw-pointer-ub.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/ui/consts/const-eval/raw-pointer-ub.stderr
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/consts/const-eval/raw-pointer-ub.stderr')
-rw-r--r--tests/ui/consts/const-eval/raw-pointer-ub.stderr42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/raw-pointer-ub.stderr b/tests/ui/consts/const-eval/raw-pointer-ub.stderr
new file mode 100644
index 000000000..60fcd461c
--- /dev/null
+++ b/tests/ui/consts/const-eval/raw-pointer-ub.stderr
@@ -0,0 +1,42 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/raw-pointer-ub.rs:7:16
+ |
+LL | let _val = *ptr;
+ | ^^^^ accessing memory based on pointer with alignment 1, but alignment 4 is required
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/raw-pointer-ub.rs:14:5
+ |
+LL | *ptr = 0;
+ | ^^^^^^^^ accessing memory based on pointer with alignment 1, but alignment 4 is required
+
+error[E0080]: evaluation of constant value failed
+ --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ |
+ = note: accessing memory with alignment 1, but alignment 4 is required
+ |
+note: inside `copy_nonoverlapping::<u32>`
+ --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
+note: inside `ptr::const_ptr::<impl *const u32>::copy_to_nonoverlapping`
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+note: inside `MISALIGNED_COPY`
+ --> $DIR/raw-pointer-ub.rs:22:5
+ |
+LL | y.copy_to_nonoverlapping(&mut z, 1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/raw-pointer-ub.rs:34:16
+ |
+LL | let _val = (*ptr).0;
+ | ^^^^^^^^ accessing memory based on pointer with alignment 4, but alignment 16 is required
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/raw-pointer-ub.rs:41:16
+ |
+LL | let _val = *ptr;
+ | ^^^^ memory access failed: ALLOC0 has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0080`.