@@ -245,8 +245,8 @@ impl<T: ?Sized> *const T {
245
245
///
246
246
/// This operation itself is always safe, but using the resulting pointer is not.
247
247
///
248
- /// The resulting pointer remains attached to the same [allocated object] that `self` points to.
249
- /// It may *not* be used to access a different allocated object .
248
+ /// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
249
+ /// be used to read or write other allocated objects .
250
250
///
251
251
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
252
252
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
@@ -264,9 +264,6 @@ impl<T: ?Sized> *const T {
264
264
/// `x.wrapping_offset(o).wrapping_offset(o.wrapping_neg())` is always the same as `x`. In other
265
265
/// words, leaving the allocated object and then re-entering it later is permitted.
266
266
///
267
- /// If you need to cross object boundaries, cast the pointer to an integer and
268
- /// do the arithmetic there.
269
- ///
270
267
/// [`offset`]: #method.offset
271
268
/// [allocated object]: crate::ptr#allocated-object
272
269
///
@@ -594,8 +591,8 @@ impl<T: ?Sized> *const T {
594
591
///
595
592
/// This operation itself is always safe, but using the resulting pointer is not.
596
593
///
597
- /// The resulting pointer remains attached to the same [allocated object] that `self` points to.
598
- /// It may *not* be used to access a different allocated object .
594
+ /// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
595
+ /// be used to read or write other allocated objects .
599
596
///
600
597
/// In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z`
601
598
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
@@ -613,9 +610,6 @@ impl<T: ?Sized> *const T {
613
610
/// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the
614
611
/// allocated object and then re-entering it later is permitted.
615
612
///
616
- /// If you need to cross object boundaries, cast the pointer to an integer and
617
- /// do the arithmetic there.
618
- ///
619
613
/// [`add`]: #method.add
620
614
/// [allocated object]: crate::ptr#allocated-object
621
615
///
@@ -659,8 +653,8 @@ impl<T: ?Sized> *const T {
659
653
///
660
654
/// This operation itself is always safe, but using the resulting pointer is not.
661
655
///
662
- /// The resulting pointer remains attached to the same [allocated object] that `self` points to.
663
- /// It may *not* be used to access a different allocated object .
656
+ /// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
657
+ /// be used to read or write other allocated objects .
664
658
///
665
659
/// In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z`
666
660
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
@@ -678,9 +672,6 @@ impl<T: ?Sized> *const T {
678
672
/// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the
679
673
/// allocated object and then re-entering it later is permitted.
680
674
///
681
- /// If you need to cross object boundaries, cast the pointer to an integer and
682
- /// do the arithmetic there.
683
- ///
684
675
/// [`sub`]: #method.sub
685
676
/// [allocated object]: crate::ptr#allocated-object
686
677
///
0 commit comments