Skip to content

Commit ad93272

Browse files
committedAug 25, 2022
Stabilize const_ptr_offset_from.
Stabilization has been completed [here](rust-lang#92980 (comment)) with a FCP.
1 parent 5462da5 commit ad93272

File tree

8 files changed

+4
-9
lines changed

8 files changed

+4
-9
lines changed
 

‎library/core/src/intrinsics.rs

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

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

20192019
/// See documentation of `<*const T>::sub_ptr` for details.
2020-
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
2020+
#[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")]
20212021
pub fn ptr_offset_from_unsigned<T>(ptr: *const T, base: *const T) -> usize;
20222022

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

‎library/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)]

‎library/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

‎library/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

‎src/test/ui/consts/const-eval/issue-91827-extern-types.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Test that we can handle unsized types with an extern type tail part.
44
// Regression test for issue #91827.
55

6-
#![feature(const_ptr_offset_from)]
76
#![feature(extern_types)]
87

98
use std::ptr::addr_of;

‎src/test/ui/consts/offset.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
#![feature(const_ptr_offset_from)]
32
use std::ptr;
43

54
#[repr(C)]

‎src/test/ui/consts/offset_from.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22

3-
#![feature(const_ptr_offset_from)]
43
#![feature(const_ptr_sub_ptr)]
54
#![feature(ptr_sub_ptr)]
65

‎src/test/ui/consts/offset_from_ub.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(const_ptr_offset_from)]
21
#![feature(core_intrinsics)]
32

43
use std::intrinsics::{ptr_offset_from, ptr_offset_from_unsigned};

0 commit comments

Comments
 (0)