]> git.lizzy.rs Git - rust.git/commitdiff
Always report alignment failures in future incompat summaries
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Tue, 22 Nov 2022 11:52:26 +0000 (11:52 +0000)
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Thu, 15 Dec 2022 16:24:11 +0000 (16:24 +0000)
compiler/rustc_lint_defs/src/builtin.rs
src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr

index dddc200b2fb1a1bcb88af87cb6a32c72f0d3072c..111e6b961543e6105ee09e762a85c98450b68697 100644 (file)
     "raw pointers must be aligned before dereferencing",
     @future_incompatible = FutureIncompatibleInfo {
         reference: "issue #68585 <https://github.com/rust-lang/rust/issues/104616>",
+        reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow,
     };
 }
 
index 8cd3918c0b4077e0bee864c5c87be00e248c2fde..6e6cbb34aeb82a9799c795a4713f9351e66aa6d0 100644 (file)
@@ -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::<u32>`
+  --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+   |
+   = 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
+
index 77c52788a9cb9e075e7bd2921c7eb4659032f83f..3d1f36f001227e5da11a7e619d5791856db923f8 100644 (file)
@@ -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::<u32>`
+  --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+   |
+   = 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
+