diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-06 08:09:55 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-12 16:36:57 -0500 |
| commit | 997feacddd8f6e98003428265c665f7149c49a48 (patch) | |
| tree | f44b97e054e863224a1a94bde6011488df57e470 /src/libcore/ptr | |
| parent | f4edc81ac4944c2cd59e19fd90861a26dde94041 (diff) | |
| download | rust-997feacddd8f6e98003428265c665f7149c49a48.tar.gz rust-997feacddd8f6e98003428265c665f7149c49a48.zip | |
Snap cfgs
Diffstat (limited to 'src/libcore/ptr')
| -rw-r--r-- | src/libcore/ptr/mod.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 5a75730cf2b..39d56958f5d 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -1301,7 +1301,6 @@ impl<T: ?Sized> *const T { /// } /// ``` #[unstable(feature = "ptr_offset_from", issue = "41079")] - #[cfg(not(bootstrap))] #[rustc_const_unstable(feature = "const_ptr_offset_from")] #[inline] pub const unsafe fn offset_from(self, origin: *const T) -> isize where T: Sized { @@ -1313,21 +1312,6 @@ impl<T: ?Sized> *const T { intrinsics::ptr_offset_from(self, origin) } - #[unstable(feature = "ptr_offset_from", issue = "41079")] - #[inline] - #[cfg(bootstrap)] - /// bootstrap - pub unsafe fn offset_from(self, origin: *const T) -> isize where T: Sized { - let pointee_size = mem::size_of::<T>(); - assert!(0 < pointee_size && pointee_size <= isize::max_value() as usize); - - // This is the same sequence that Clang emits for pointer subtraction. - // It can be neither `nsw` nor `nuw` because the input is treated as - // unsigned but then the output is treated as signed, so neither works. - let d = isize::wrapping_sub(self as _, origin as _); - intrinsics::exact_div(d, pointee_size as _) - } - /// Calculates the distance between two pointers. The returned value is in /// units of T: the distance in bytes is divided by `mem::size_of::<T>()`. /// |
