File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -1426,6 +1426,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
14261426
14271427 // SAFETY: the caller must guarantee that `src` is valid for reads.
14281428 unsafe {
1429+ #[ cfg( debug_assertions) ]
14291430 ub_checks:: assert_unsafe_precondition!(
14301431 check_language_ub,
14311432 "ptr::read requires that the pointer argument is aligned and non-null" ,
@@ -1634,7 +1635,6 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
16341635 // `dst` cannot overlap `src` because the caller has mutable access
16351636 // to `dst` while `src` is owned by this function.
16361637 unsafe {
1637- #[ cfg( debug_assertions) ]
16381638 ub_checks:: assert_unsafe_precondition!(
16391639 check_language_ub,
16401640 "ptr::write requires that the pointer argument is aligned and non-null" ,
You can’t perform that action at this time.
0 commit comments