Skip to content

Commit a07bbb2

Browse files
authored
Rollup merge of #99692 - RalfJung:too-far, r=oli-obk
interpret, ptr_offset_from: refactor and test too-far-apart check We didn't have any tests for the "too far apart" message, and indeed that check mostly relied on the in-bounds check and was otherwise probably not entirely correct... so I rewrote that check, and it is before the in-bounds check so we can test it separately.
2 parents c7ee8f2 + 9cd8624 commit a07bbb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/ptr/const_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ impl<T: ?Sized> *const T {
730730
/// }
731731
///
732732
/// // This would be incorrect, as the pointers are not correctly ordered:
733-
/// // ptr1.offset_from(ptr2)
733+
/// // ptr1.sub_ptr(ptr2)
734734
/// ```
735735
#[unstable(feature = "ptr_sub_ptr", issue = "95892")]
736736
#[rustc_const_unstable(feature = "const_ptr_sub_ptr", issue = "95892")]

0 commit comments

Comments
 (0)