Skip to content

Commit 2986cc0

Browse files
committed
cfg out the check in write
1 parent deb9d38 commit 2986cc0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/ptr/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
16341634
// `dst` cannot overlap `src` because the caller has mutable access
16351635
// to `dst` while `src` is owned by this function.
16361636
unsafe {
1637+
#[cfg(debug_assertions)]
16371638
ub_checks::assert_unsafe_precondition!(
16381639
check_language_ub,
16391640
"ptr::write requires that the pointer argument is aligned and non-null",

0 commit comments

Comments
 (0)