diff options
| author | SaltyKitkat <954537646@qq.com> | 2022-02-13 15:26:14 +0800 |
|---|---|---|
| committer | SaltyKitkat <954537646@qq.com> | 2022-02-13 15:26:14 +0800 |
| commit | 3c142b0ffef3d423ee1e176b30892702d3eb29ac (patch) | |
| tree | c69f3112d4642f7657d8218706d048a61f94de60 /library | |
| parent | 1d9c262eea411ec5230f8a4c9ba50b3647064da4 (diff) | |
| download | rust-3c142b0ffef3d423ee1e176b30892702d3eb29ac.tar.gz rust-3c142b0ffef3d423ee1e176b30892702d3eb29ac.zip | |
stabilize const_ptr_offset
Diffstat (limited to 'library')
| -rw-r--r-- | library/alloc/tests/lib.rs | 1 | ||||
| -rw-r--r-- | library/core/src/intrinsics.rs | 4 | ||||
| -rw-r--r-- | library/core/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/core/src/ptr/const_ptr.rs | 12 | ||||
| -rw-r--r-- | library/core/src/ptr/mut_ptr.rs | 12 | ||||
| -rw-r--r-- | library/core/src/slice/mod.rs | 6 | ||||
| -rw-r--r-- | library/core/tests/lib.rs | 1 |
7 files changed, 17 insertions, 20 deletions
diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs index cbb86265233..abce47e5afe 100644 --- a/library/alloc/tests/lib.rs +++ b/library/alloc/tests/lib.rs @@ -10,7 +10,6 @@ #![feature(const_intrinsic_copy)] #![feature(const_mut_refs)] #![feature(const_nonnull_slice_from_raw_parts)] -#![feature(const_ptr_offset)] #![feature(const_ptr_write)] #![feature(const_try)] #![feature(core_intrinsics)] diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 22c6c1cd868..2aa6cbd2d3c 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -1168,7 +1168,7 @@ extern "rust-intrinsic" { /// /// The stabilized version of this intrinsic is [`pointer::offset`]. #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] pub fn offset<T>(dst: *const T, offset: isize) -> *const T; /// Calculates the offset from a pointer, potentially wrapping. @@ -1185,7 +1185,7 @@ extern "rust-intrinsic" { /// /// The stabilized version of this intrinsic is [`pointer::wrapping_offset`]. #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] pub fn arith_offset<T>(dst: *const T, offset: isize) -> *const T; /// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 1a85e2ef7b6..5c16346cbd1 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -126,7 +126,6 @@ #![feature(const_pin)] #![feature(const_replace)] #![feature(const_ptr_is_null)] -#![feature(const_ptr_offset)] #![feature(const_ptr_offset_from)] #![feature(const_ptr_read)] #![feature(const_ptr_write)] diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index 19953afb4fe..aaccc203cb0 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -285,7 +285,7 @@ impl<T: ?Sized> *const T { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const unsafe fn offset(self, count: isize) -> *const T where @@ -347,7 +347,7 @@ impl<T: ?Sized> *const T { /// ``` #[stable(feature = "ptr_wrapping_offset", since = "1.16.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const fn wrapping_offset(self, count: isize) -> *const T where @@ -566,7 +566,7 @@ impl<T: ?Sized> *const T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const unsafe fn add(self, count: usize) -> Self where @@ -630,7 +630,7 @@ impl<T: ?Sized> *const T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline] pub const unsafe fn sub(self, count: usize) -> Self where @@ -693,7 +693,7 @@ impl<T: ?Sized> *const T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const fn wrapping_add(self, count: usize) -> Self where @@ -755,7 +755,7 @@ impl<T: ?Sized> *const T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline] pub const fn wrapping_sub(self, count: usize) -> Self where diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 861412703d3..275c057bd9c 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -295,7 +295,7 @@ impl<T: ?Sized> *mut T { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const unsafe fn offset(self, count: isize) -> *mut T where @@ -358,7 +358,7 @@ impl<T: ?Sized> *mut T { /// ``` #[stable(feature = "ptr_wrapping_offset", since = "1.16.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const fn wrapping_offset(self, count: isize) -> *mut T where @@ -680,7 +680,7 @@ impl<T: ?Sized> *mut T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const unsafe fn add(self, count: usize) -> Self where @@ -744,7 +744,7 @@ impl<T: ?Sized> *mut T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline] pub const unsafe fn sub(self, count: usize) -> Self where @@ -807,7 +807,7 @@ impl<T: ?Sized> *mut T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline(always)] pub const fn wrapping_add(self, count: usize) -> Self where @@ -869,7 +869,7 @@ impl<T: ?Sized> *mut T { /// ``` #[stable(feature = "pointer_methods", since = "1.26.0")] #[must_use = "returns a new pointer rather than modifying its argument"] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline] pub const fn wrapping_sub(self, count: usize) -> Self where diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index c661f47387f..3435b11351b 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -499,7 +499,7 @@ impl<T> [T] { /// assert_eq!(x, &[3, 4, 6]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline] #[must_use] pub const fn as_mut_ptr(&mut self) -> *mut T { @@ -535,7 +535,7 @@ impl<T> [T] { /// /// [`as_ptr`]: slice::as_ptr #[stable(feature = "slice_ptr_range", since = "1.48.0")] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline] #[must_use] pub const fn as_ptr_range(&self) -> Range<*const T> { @@ -578,7 +578,7 @@ impl<T> [T] { /// /// [`as_mut_ptr`]: slice::as_mut_ptr #[stable(feature = "slice_ptr_range", since = "1.48.0")] - #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[rustc_const_stable(feature = "const_ptr_offset", since = "1.60.0")] #[inline] #[must_use] pub const fn as_mut_ptr_range(&mut self) -> Range<*mut T> { diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 5c861236e86..5f90a76ab74 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -20,7 +20,6 @@ #![feature(const_ptr_as_ref)] #![feature(const_ptr_read)] #![feature(const_ptr_write)] -#![feature(const_ptr_offset)] #![feature(const_trait_impl)] #![feature(const_likely)] #![feature(core_ffi_c)] |
