@@ -522,7 +522,8 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
522
522
ub_checks:: assert_unsafe_precondition!(
523
523
check_language_ub,
524
524
"ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null \
525
- and the specified memory ranges do not overlap",
525
+ and the specified memory ranges do not overlap \
526
+ (src{src:?}, dst:{dst:?}, size:{size:?}, align:{align:?}, count:{count:?})",
526
527
(
527
528
src: * const ( ) = src as * const ( ) ,
528
529
dst: * mut ( ) = dst as * mut ( ) ,
@@ -620,7 +621,8 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
620
621
unsafe {
621
622
ub_checks:: assert_unsafe_precondition!(
622
623
check_language_ub,
623
- "ptr::copy requires that both pointer arguments are aligned and non-null" ,
624
+ "ptr::copy requires that both pointer arguments are aligned and non-null \
625
+ (src{src:?}, dst:{dst:?}, align:{align:?})",
624
626
(
625
627
src: * const ( ) = src as * const ( ) ,
626
628
dst: * mut ( ) = dst as * mut ( ) ,
@@ -694,7 +696,8 @@ pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
694
696
unsafe {
695
697
ub_checks:: assert_unsafe_precondition!(
696
698
check_language_ub,
697
- "ptr::write_bytes requires that the destination pointer is aligned and non-null" ,
699
+ "ptr::write_bytes requires that the destination pointer is aligned and non-null \
700
+ (dst:{addr:?}, align:{align})",
698
701
(
699
702
addr: * const ( ) = dst as * const ( ) ,
700
703
align: usize = align_of:: <T >( ) ,
@@ -1384,7 +1387,8 @@ pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
1384
1387
ub_checks:: assert_unsafe_precondition!(
1385
1388
check_library_ub,
1386
1389
"ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null \
1387
- and the specified memory ranges do not overlap",
1390
+ and the specified memory ranges do not overlap \
1391
+ (x:{x:?}, y:{y:?}, size:{size}, align:{align}, count:{count})",
1388
1392
(
1389
1393
x: * mut ( ) = x as * mut ( ) ,
1390
1394
y: * mut ( ) = y as * mut ( ) ,
@@ -1569,7 +1573,8 @@ pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
1569
1573
unsafe {
1570
1574
ub_checks:: assert_unsafe_precondition!(
1571
1575
check_language_ub,
1572
- "ptr::replace requires that the pointer argument is aligned and non-null" ,
1576
+ "ptr::replace requires that the pointer argument is aligned and non-null\
1577
+ (dst:{addr:?}, (align:{align}))",
1573
1578
(
1574
1579
addr: * const ( ) = dst as * const ( ) ,
1575
1580
align: usize = align_of:: <T >( ) ,
@@ -1722,7 +1727,8 @@ pub const unsafe fn read<T>(src: *const T) -> T {
1722
1727
#[ cfg( debug_assertions) ] // Too expensive to always enable (for now?)
1723
1728
ub_checks:: assert_unsafe_precondition!(
1724
1729
check_language_ub,
1725
- "ptr::read requires that the pointer argument is aligned and non-null" ,
1730
+ "ptr::read requires that the pointer argument is aligned and non-null \
1731
+ (src:{addr:?}, align:{align})",
1726
1732
(
1727
1733
addr: * const ( ) = src as * const ( ) ,
1728
1734
align: usize = align_of:: <T >( ) ,
@@ -1922,7 +1928,8 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
1922
1928
#[ cfg( debug_assertions) ] // Too expensive to always enable (for now?)
1923
1929
ub_checks:: assert_unsafe_precondition!(
1924
1930
check_language_ub,
1925
- "ptr::write requires that the pointer argument is aligned and non-null" ,
1931
+ "ptr::write requires that the pointer argument is aligned and non-null \
1932
+ (dst:{addr:?}, align:{align})",
1926
1933
(
1927
1934
addr: * mut ( ) = dst as * mut ( ) ,
1928
1935
align: usize = align_of:: <T >( ) ,
@@ -2090,7 +2097,8 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
2090
2097
unsafe {
2091
2098
ub_checks:: assert_unsafe_precondition!(
2092
2099
check_language_ub,
2093
- "ptr::read_volatile requires that the pointer argument is aligned and non-null" ,
2100
+ "ptr::read_volatile requires that the pointer argument is aligned and non-null \
2101
+ (src:{addr:?}, align:{align})",
2094
2102
(
2095
2103
addr: * const ( ) = src as * const ( ) ,
2096
2104
align: usize = align_of:: <T >( ) ,
@@ -2170,7 +2178,8 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
2170
2178
unsafe {
2171
2179
ub_checks:: assert_unsafe_precondition!(
2172
2180
check_language_ub,
2173
- "ptr::write_volatile requires that the pointer argument is aligned and non-null" ,
2181
+ "ptr::write_volatile requires that the pointer argument is aligned and non-null \
2182
+ (dst:{addr:?}, align:{align})",
2174
2183
(
2175
2184
addr: * mut ( ) = dst as * mut ( ) ,
2176
2185
align: usize = align_of:: <T >( ) ,
0 commit comments