diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index dddc200b2fb..111e6b96154 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -1052,6 +1052,7 @@ declare_lint! { "raw pointers must be aligned before dereferencing", @future_incompatible = FutureIncompatibleInfo { reference: "issue #68585 ", + reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow, }; } 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 8cd3918c0b4..6e6cbb34aeb 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 @@ -168,3 +168,21 @@ LL | ptr.read(); error: aborting due to 15 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: accessing memory with alignment 1, but alignment 4 is required + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | + = note: inside `std::ptr::read::` + --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | + = note: inside `ptr::const_ptr::::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 + = note: `#[deny(invalid_alignment)]` on by default + 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 77c52788a9c..3d1f36f0012 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 @@ -168,3 +168,21 @@ LL | ptr.read(); error: aborting due to 15 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: accessing memory with alignment 1, but alignment 4 is required + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | + = note: inside `std::ptr::read::` + --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | + = note: inside `ptr::const_ptr::::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 + = note: `#[deny(invalid_alignment)]` on by default +