@@ -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,
@@ -789,7 +790,8 @@ impl<T: ?Sized> *const T {
789
790
790
791
ub_checks:: assert_unsafe_precondition!(
791
792
check_language_ub,
792
- "ptr::sub_ptr requires `self >= origin`" ,
793
+ "ptr::sub_ptr requires `self >= origin` \
794
+ (self:{this:?}, origin:{origin:?})",
793
795
(
794
796
this: * const ( ) = self as * const ( ) ,
795
797
origin: * const ( ) = origin as * const ( ) ,
@@ -955,7 +957,8 @@ impl<T: ?Sized> *const T {
955
957
#[ cfg( debug_assertions) ] // Expensive, and doesn't catch much in the wild.
956
958
ub_checks:: assert_unsafe_precondition!(
957
959
check_language_ub,
958
- "ptr::add requires that the address calculation does not overflow" ,
960
+ "ptr::add requires that the address calculation does not overflow \
961
+ (self:{this:?}, count:{count}, size:{size})",
959
962
(
960
963
this: * const ( ) = self as * const ( ) ,
961
964
count: usize = count,
@@ -1060,7 +1063,8 @@ impl<T: ?Sized> *const T {
1060
1063
#[ cfg( debug_assertions) ] // Expensive, and doesn't catch much in the wild.
1061
1064
ub_checks:: assert_unsafe_precondition!(
1062
1065
check_language_ub,
1063
- "ptr::sub requires that the address calculation does not overflow" ,
1066
+ "ptr::sub requires that the address calculation does not overflow \
1067
+ (self:{this:?}, count:{count}, size:{size})",
1064
1068
(
1065
1069
this: * const ( ) = self as * const ( ) ,
1066
1070
count: usize = count,
0 commit comments