Skip to content

Commit 64721b5

Browse files
authoredAug 27, 2022
Rollup merge of #96240 - fee1-dead-contrib:stabilize_const_offset_from, r=Mark-Simulacrum
Stabilize `const_ptr_offset_from`. Stabilization has been completed [here](rust-lang/rust#92980 (comment)) with a FCP. Closes #92980.
2 parents 84d79aa + 6056f2e commit 64721b5

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed
 

‎core/src/intrinsics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1992,11 +1992,11 @@ extern "rust-intrinsic" {
19921992
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
19931993

19941994
/// See documentation of `<*const T>::offset_from` for details.
1995-
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
1995+
#[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")]
19961996
pub fn ptr_offset_from<T>(ptr: *const T, base: *const T) -> isize;
19971997

19981998
/// See documentation of `<*const T>::sub_ptr` for details.
1999-
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
1999+
#[rustc_const_unstable(feature = "const_ptr_sub_ptr", issue = "95892")]
20002000
pub fn ptr_offset_from_unsigned<T>(ptr: *const T, base: *const T) -> usize;
20012001

20022002
/// See documentation of `<*const T>::guaranteed_eq` for details.

‎core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130
#![feature(const_replace)]
131131
#![feature(const_ptr_as_ref)]
132132
#![feature(const_ptr_is_null)]
133-
#![feature(const_ptr_offset_from)]
134133
#![feature(const_ptr_read)]
135134
#![feature(const_ptr_write)]
136135
#![feature(const_raw_ptr_comparison)]

‎core/src/ptr/const_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl<T: ?Sized> *const T {
641641
/// }
642642
/// ```
643643
#[stable(feature = "ptr_offset_from", since = "1.47.0")]
644-
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
644+
#[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")]
645645
#[inline]
646646
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
647647
pub const unsafe fn offset_from(self, origin: *const T) -> isize

‎core/src/ptr/mut_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ impl<T: ?Sized> *mut T {
824824
/// }
825825
/// ```
826826
#[stable(feature = "ptr_offset_from", since = "1.47.0")]
827-
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
827+
#[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")]
828828
#[inline(always)]
829829
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
830830
pub const unsafe fn offset_from(self, origin: *const T) -> isize

0 commit comments

Comments
 (0)
Please sign in to comment.