Skip to content

Commit 058ff72

Browse files
committed
debug-assert ptr sanity in ptr::write
1 parent 1572c43 commit 058ff72

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libcore/ptr/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,7 @@ pub unsafe fn read_unaligned<T>(src: *const T) -> T {
810810
#[inline]
811811
#[stable(feature = "rust1", since = "1.0.0")]
812812
pub unsafe fn write<T>(dst: *mut T, src: T) {
813-
// FIXME: the debug assertion here causes codegen test failures on some architectures.
814-
// See <https://github.com/rust-lang/rust/pull/69208#issuecomment-591326757>.
815-
// debug_assert!(is_aligned_and_not_null(dst), "attempt to write to unaligned or null pointer");
813+
debug_assert!(is_aligned_and_not_null(dst), "attempt to write to unaligned or null pointer");
816814
intrinsics::move_val_init(&mut *dst, src)
817815
}
818816

0 commit comments

Comments
 (0)