File tree 1 file changed +1
-1
lines changed
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 {
1426
1426
1427
1427
// SAFETY: the caller must guarantee that `src` is valid for reads.
1428
1428
unsafe {
1429
+ #[ cfg( debug_assertions) ]
1429
1430
ub_checks:: assert_unsafe_precondition!(
1430
1431
check_language_ub,
1431
1432
"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) {
1634
1635
// `dst` cannot overlap `src` because the caller has mutable access
1635
1636
// to `dst` while `src` is owned by this function.
1636
1637
unsafe {
1637
- #[ cfg( debug_assertions) ]
1638
1638
ub_checks:: assert_unsafe_precondition!(
1639
1639
check_language_ub,
1640
1640
"ptr::write requires that the pointer argument is aligned and non-null" ,
You can’t perform that action at this time.
0 commit comments