Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 058ff72

Browse files
committedMar 14, 2020
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

Lines changed: 1 addition & 3 deletions
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)
Please sign in to comment.