@@ -443,7 +443,8 @@ impl<T: ?Sized> *const T {
443443
444444 ub_checks:: assert_unsafe_precondition!(
445445 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})",
447448 (
448449 this: * const ( ) = self as * const ( ) ,
449450 count: isize = count,
@@ -786,7 +787,8 @@ impl<T: ?Sized> *const T {
786787
787788 ub_checks:: assert_unsafe_precondition!(
788789 check_language_ub,
789- "ptr::offset_from_unsigned requires `self >= origin`" ,
790+ "ptr::offset_from_unsigned requires `self >= origin` \
791+ (self:{this:?}, origin:{origin:?})",
790792 (
791793 this: * const ( ) = self as * const ( ) ,
792794 origin: * const ( ) = origin as * const ( ) ,
@@ -952,7 +954,8 @@ impl<T: ?Sized> *const T {
952954 #[ cfg( debug_assertions) ] // Expensive, and doesn't catch much in the wild.
953955 ub_checks:: assert_unsafe_precondition!(
954956 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})",
956959 (
957960 this: * const ( ) = self as * const ( ) ,
958961 count: usize = count,
@@ -1057,7 +1060,8 @@ impl<T: ?Sized> *const T {
10571060 #[ cfg( debug_assertions) ] // Expensive, and doesn't catch much in the wild.
10581061 ub_checks:: assert_unsafe_precondition!(
10591062 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})",
10611065 (
10621066 this: * const ( ) = self as * const ( ) ,
10631067 count: usize = count,
0 commit comments