@@ -443,7 +443,8 @@ impl<T: ?Sized> *const T {
443
443
444
444
ub_checks:: assert_unsafe_precondition!(
445
445
check_language_ub,
446
- "ptr::offset requires the address calculation to not overflow" ,
446
+ "ptr::offset requires the address calculation to not overflow \
447
+ (ptr:{this:?}, count:{count}, size:{size})" ,
447
448
(
448
449
this: * const ( ) = self as * const ( ) ,
449
450
count: isize = count,
@@ -786,7 +787,8 @@ impl<T: ?Sized> *const T {
786
787
787
788
ub_checks:: assert_unsafe_precondition!(
788
789
check_language_ub,
789
- "ptr::offset_from_unsigned requires `self >= origin`" ,
790
+ "ptr::offset_from_unsigned requires `self >= origin` \
791
+ (self:{this:?}, origin:{origin:?})" ,
790
792
(
791
793
this: * const ( ) = self as * const ( ) ,
792
794
origin: * const ( ) = origin as * const ( ) ,
@@ -952,7 +954,8 @@ impl<T: ?Sized> *const T {
952
954
#[ cfg( debug_assertions) ] // Expensive, and doesn't catch much in the wild.
953
955
ub_checks:: assert_unsafe_precondition!(
954
956
check_language_ub,
955
- "ptr::add requires that the address calculation does not overflow" ,
957
+ "ptr::add requires that the address calculation does not overflow \
958
+ (self:{this:?}, count:{count}, size:{size})" ,
956
959
(
957
960
this: * const ( ) = self as * const ( ) ,
958
961
count: usize = count,
@@ -1057,7 +1060,8 @@ impl<T: ?Sized> *const T {
1057
1060
#[ cfg( debug_assertions) ] // Expensive, and doesn't catch much in the wild.
1058
1061
ub_checks:: assert_unsafe_precondition!(
1059
1062
check_language_ub,
1060
- "ptr::sub requires that the address calculation does not overflow" ,
1063
+ "ptr::sub requires that the address calculation does not overflow \
1064
+ (self:{this:?}, count:{count}, size:{size})" ,
1061
1065
(
1062
1066
this: * const ( ) = self as * const ( ) ,
1063
1067
count: usize = count,
0 commit comments