From fed12fad7019051fc875a06d3699d660ea1e226a Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 19 Jun 2019 18:46:12 +0200 Subject: [PATCH 1/2] Remove mentions of removed `offset_to` method --- src/libcore/ptr/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 8f026a5b7d8..337f3440b43 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -1534,7 +1534,7 @@ impl *const T { /// `usize::max_value()`. /// /// The offset is expressed in number of `T` elements, and not bytes. The value returned can be - /// used with the `offset` or `offset_to` methods. + /// used with the `offset` method. /// /// There are no guarantees whatsover that offsetting the pointer will not overflow or go /// beyond the allocation that the pointer points into. It is up to the caller to ensure that @@ -2335,7 +2335,7 @@ impl *mut T { /// `usize::max_value()`. /// /// The offset is expressed in number of `T` elements, and not bytes. The value returned can be - /// used with the `offset` or `offset_to` methods. + /// used with the `offset` method. /// /// There are no guarantees whatsover that offsetting the pointer will not overflow or go /// beyond the allocation that the pointer points into. It is up to the caller to ensure that From c9c73f5d2550f00e9b952e65d05421721b73ee6d Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 17 Jul 2019 17:25:43 +0200 Subject: [PATCH 2/2] Refer to `add` method instead of `offset` The `align_offset` method returns an `usize`, so using `add` makes more sense than using `offset`, which takes an `isize`. --- src/libcore/ptr/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 337f3440b43..e8c988b921a 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -1534,7 +1534,7 @@ impl *const T { /// `usize::max_value()`. /// /// The offset is expressed in number of `T` elements, and not bytes. The value returned can be - /// used with the `offset` method. + /// used with the `add` method. /// /// There are no guarantees whatsover that offsetting the pointer will not overflow or go /// beyond the allocation that the pointer points into. It is up to the caller to ensure that @@ -2335,7 +2335,7 @@ impl *mut T { /// `usize::max_value()`. /// /// The offset is expressed in number of `T` elements, and not bytes. The value returned can be - /// used with the `offset` method. + /// used with the `add` method. /// /// There are no guarantees whatsover that offsetting the pointer will not overflow or go /// beyond the allocation that the pointer points into. It is up to the caller to ensure that