From 4547b622d8d29df964fa2914213088b148c498fc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:32 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/consts/extra-const-ub/detect-extra-ub.rs | 2 +- .../detect-extra-ub.with_flag.stderr | 27 ++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'src/test/ui/consts/extra-const-ub') diff --git a/src/test/ui/consts/extra-const-ub/detect-extra-ub.rs b/src/test/ui/consts/extra-const-ub/detect-extra-ub.rs index 159cdf257..9c239c8a1 100644 --- a/src/test/ui/consts/extra-const-ub/detect-extra-ub.rs +++ b/src/test/ui/consts/extra-const-ub/detect-extra-ub.rs @@ -29,7 +29,7 @@ const UNALIGNED_PTR: () = unsafe { }; const UNALIGNED_READ: () = { - INNER; //[with_flag]~ERROR evaluation of constant value failed + INNER; //[with_flag]~ constant // There is an error here but its span is in the standard library so we cannot match it... // so we have this in a *nested* const, such that the *outer* const fails to use it. const INNER: () = unsafe { diff --git a/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr b/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr index 3e1195822..2603a7358 100644 --- a/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr +++ b/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr @@ -32,27 +32,30 @@ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | accessing memory with alignment 1, but alignment 4 is required - | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment 1, but alignment 4 is required | - ::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL +note: inside `std::ptr::read::` + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | unsafe { read(self) } - | ---------- inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL +LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: inside `ptr::const_ptr::::read` + --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | - ::: $DIR/detect-extra-ub.rs:38:9 +LL | unsafe { read(self) } + | ^^^^^^^^^^ +note: inside `INNER` + --> $DIR/detect-extra-ub.rs:38:9 | LL | ptr.read(); - | ---------- inside `INNER` at $DIR/detect-extra-ub.rs:38:9 + | ^^^^^^^^^^ -error[E0080]: evaluation of constant value failed +note: erroneous constant used --> $DIR/detect-extra-ub.rs:32:5 | LL | INNER; - | ^^^^^ referenced constant has errors + | ^^^^^ -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0080`. -- cgit v1.2.3