From 9bb5a697b98ae41ed1947ec2ab0e905bdfbfa0d0 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Wed, 20 Apr 2022 14:42:18 +1000 Subject: [PATCH] Stabilize `const_ptr_offset_from`. Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848) with a FCP. --- core/src/intrinsics.rs | 4 ++-- core/src/lib.rs | 1 - core/src/ptr/const_ptr.rs | 2 +- core/src/ptr/mut_ptr.rs | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/intrinsics.rs b/core/src/intrinsics.rs index 441d23826..c0066ff62 100644 --- a/core/src/intrinsics.rs +++ b/core/src/intrinsics.rs @@ -2013,11 +2013,11 @@ extern "rust-intrinsic" { pub fn nontemporal_store(ptr: *mut T, val: T); /// See documentation of `<*const T>::offset_from` for details. - #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")] + #[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")] pub fn ptr_offset_from(ptr: *const T, base: *const T) -> isize; /// See documentation of `<*const T>::sub_ptr` for details. - #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")] + #[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")] pub fn ptr_offset_from_unsigned(ptr: *const T, base: *const T) -> usize; /// See documentation of `<*const T>::guaranteed_eq` for details. diff --git a/core/src/lib.rs b/core/src/lib.rs index 8d04a213f..60f38426b 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -130,7 +130,6 @@ #![feature(const_replace)] #![feature(const_ptr_as_ref)] #![feature(const_ptr_is_null)] -#![feature(const_ptr_offset_from)] #![feature(const_ptr_read)] #![feature(const_ptr_write)] #![feature(const_raw_ptr_comparison)] diff --git a/core/src/ptr/const_ptr.rs b/core/src/ptr/const_ptr.rs index c25b159c5..08fbb79fa 100644 --- a/core/src/ptr/const_ptr.rs +++ b/core/src/ptr/const_ptr.rs @@ -641,7 +641,7 @@ impl *const T { /// } /// ``` #[stable(feature = "ptr_offset_from", since = "1.47.0")] - #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")] + #[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")] #[inline] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces pub const unsafe fn offset_from(self, origin: *const T) -> isize diff --git a/core/src/ptr/mut_ptr.rs b/core/src/ptr/mut_ptr.rs index fff06b458..846746905 100644 --- a/core/src/ptr/mut_ptr.rs +++ b/core/src/ptr/mut_ptr.rs @@ -824,7 +824,7 @@ impl *mut T { /// } /// ``` #[stable(feature = "ptr_offset_from", since = "1.47.0")] - #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")] + #[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")] #[inline(always)] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces pub const unsafe fn offset_from(self, origin: *const T) -> isize