Skip to content

Commit 23427d8

Browse files
committed
make unaligned_refereces future-incompat lint warn-by-default, and remove the safe_packed_borrows lint that it replaces
1 parent 7cf4405 commit 23427d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/ptr/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
767767
/// unaligned: 0x01020304,
768768
/// };
769769
///
770+
/// #[allow(unaligned_references)]
770771
/// let v = unsafe {
771772
/// // Here we attempt to take the address of a 32-bit integer which is not aligned.
772773
/// let unaligned =
@@ -960,6 +961,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
960961
/// let v = 0x01020304;
961962
/// let mut packed: Packed = unsafe { std::mem::zeroed() };
962963
///
964+
/// #[allow(unaligned_references)]
963965
/// let v = unsafe {
964966
/// // Here we attempt to take the address of a 32-bit integer which is not aligned.
965967
/// let unaligned =

0 commit comments

Comments
 (0)