This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
compiler/rustc_lint_defs/src
src/test/ui/consts/const-eval Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -1052,6 +1052,7 @@ declare_lint! {
10521052 "raw pointers must be aligned before dereferencing" ,
10531053 @future_incompatible = FutureIncompatibleInfo {
10541054 reference: "issue #68585 <https://github.com/rust-lang/rust/issues/104616>" ,
1055+ reason: FutureIncompatibilityReason :: FutureReleaseErrorReportNow ,
10551056 } ;
10561057}
10571058
Original file line number Diff line number Diff line change @@ -168,3 +168,21 @@ LL | ptr.read();
168168error: aborting due to 15 previous errors
169169
170170For more information about this error, try `rustc --explain E0080`.
171+ Future incompatibility report: Future breakage diagnostic:
172+ error: accessing memory with alignment 1, but alignment 4 is required
173+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
174+ |
175+ = note: inside `std::ptr::read::<u32>`
176+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
177+ |
178+ = note: inside `ptr::const_ptr::<impl *const u32>::read`
179+ |
180+ ::: $DIR/ub-ref-ptr.rs:65:5
181+ |
182+ LL | ptr.read();
183+ | ---------- inside `UNALIGNED_READ`
184+ |
185+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
186+ = note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/104616>
187+ = note: `#[deny(invalid_alignment)]` on by default
188+
Original file line number Diff line number Diff line change @@ -168,3 +168,21 @@ LL | ptr.read();
168168error: aborting due to 15 previous errors
169169
170170For more information about this error, try `rustc --explain E0080`.
171+ Future incompatibility report: Future breakage diagnostic:
172+ error: accessing memory with alignment 1, but alignment 4 is required
173+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
174+ |
175+ = note: inside `std::ptr::read::<u32>`
176+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
177+ |
178+ = note: inside `ptr::const_ptr::<impl *const u32>::read`
179+ |
180+ ::: $DIR/ub-ref-ptr.rs:65:5
181+ |
182+ LL | ptr.read();
183+ | ---------- inside `UNALIGNED_READ`
184+ |
185+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
186+ = note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/104616>
187+ = note: `#[deny(invalid_alignment)]` on by default
188+
You can’t perform that action at this time.
0 commit comments