about summary refs log tree commit diff
path: root/src/test/ui/consts
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-11-21 16:51:16 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-12-15 16:07:28 +0000
commitd66824dbc4fb74598251a89d7c3c5fb2df5afeba (patch)
tree14f9cf94e9a62acd51d8dc04d9e4df8f5cccd7d5 /src/test/ui/consts
parented71e32e1440765d3e133e9892d59ca130477cec (diff)
downloadrust-d66824dbc4fb74598251a89d7c3c5fb2df5afeba.tar.gz
rust-d66824dbc4fb74598251a89d7c3c5fb2df5afeba.zip
Make alignment checks a future incompat lint
Diffstat (limited to 'src/test/ui/consts')
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr20
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr20
2 files changed, 22 insertions, 18 deletions
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
index b4c343e64d5..8cd3918c0b4 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
@@ -148,20 +148,22 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
                ╾─alloc41─╼                                     │ ╾──╼
            }
 
-error[E0080]: evaluation of constant value failed
+error: accessing memory with alignment 1, but alignment 4 is required
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
    |
-   = note: accessing memory with alignment 1, but alignment 4 is required
-   |
-note: inside `std::ptr::read::<u32>`
-  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
-note: inside `ptr::const_ptr::<impl *const u32>::read`
+   = note: inside `std::ptr::read::<u32>`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-note: inside `UNALIGNED_READ`
-  --> $DIR/ub-ref-ptr.rs:65:5
+   |
+   = note: inside `ptr::const_ptr::<impl *const u32>::read`
+   |
+  ::: $DIR/ub-ref-ptr.rs:65:5
    |
 LL |     ptr.read();
-   |     ^^^^^^^^^^
+   |     ---------- inside `UNALIGNED_READ`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/104616>
+   = note: `#[deny(invalid_alignment)]` on by default
 
 error: aborting due to 15 previous errors
 
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
index 012e050de84..77c52788a9c 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
@@ -148,20 +148,22 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
                ╾───────alloc41───────╼                         │ ╾──────╼
            }
 
-error[E0080]: evaluation of constant value failed
+error: accessing memory with alignment 1, but alignment 4 is required
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
    |
-   = note: accessing memory with alignment 1, but alignment 4 is required
-   |
-note: inside `std::ptr::read::<u32>`
-  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
-note: inside `ptr::const_ptr::<impl *const u32>::read`
+   = note: inside `std::ptr::read::<u32>`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-note: inside `UNALIGNED_READ`
-  --> $DIR/ub-ref-ptr.rs:65:5
+   |
+   = note: inside `ptr::const_ptr::<impl *const u32>::read`
+   |
+  ::: $DIR/ub-ref-ptr.rs:65:5
    |
 LL |     ptr.read();
-   |     ^^^^^^^^^^
+   |     ---------- inside `UNALIGNED_READ`
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/104616>
+   = note: `#[deny(invalid_alignment)]` on by default
 
 error: aborting due to 15 previous errors