Skip to content

Commit 0184ca6

Browse files
committed
revert stabilization of const_intrinsic_copy
1 parent ea37e80 commit 0184ca6

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

Diff for: library/core/src/intrinsics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2749,13 +2749,13 @@ pub(crate) fn is_nonoverlapping<T>(src: *const T, dst: *const T, count: usize) -
27492749
#[doc(alias = "memcpy")]
27502750
#[stable(feature = "rust1", since = "1.0.0")]
27512751
#[rustc_allowed_through_unstable_modules]
2752-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
2752+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
27532753
#[inline(always)]
27542754
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
27552755
#[rustc_diagnostic_item = "ptr_copy_nonoverlapping"]
27562756
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
27572757
extern "rust-intrinsic" {
2758-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
2758+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
27592759
#[rustc_nounwind]
27602760
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
27612761
}
@@ -2845,13 +2845,13 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
28452845
#[doc(alias = "memmove")]
28462846
#[stable(feature = "rust1", since = "1.0.0")]
28472847
#[rustc_allowed_through_unstable_modules]
2848-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
2848+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
28492849
#[inline(always)]
28502850
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
28512851
#[rustc_diagnostic_item = "ptr_copy"]
28522852
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
28532853
extern "rust-intrinsic" {
2854-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
2854+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
28552855
#[rustc_nounwind]
28562856
fn copy<T>(src: *const T, dst: *mut T, count: usize);
28572857
}

Diff for: library/core/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
#![feature(const_hint_assert_unchecked)]
136136
#![feature(const_index_range_slice_index)]
137137
#![feature(const_int_unchecked_arith)]
138+
#![feature(const_intrinsic_copy)]
138139
#![feature(const_intrinsic_forget)]
139140
#![feature(const_ipv4)]
140141
#![feature(const_ipv6)]

Diff for: library/core/src/ptr/const_ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ impl<T: ?Sized> *const T {
12841284
/// See [`ptr::copy`] for safety concerns and examples.
12851285
///
12861286
/// [`ptr::copy`]: crate::ptr::copy()
1287-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
1287+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
12881288
#[stable(feature = "pointer_methods", since = "1.26.0")]
12891289
#[inline]
12901290
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1304,7 +1304,7 @@ impl<T: ?Sized> *const T {
13041304
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
13051305
///
13061306
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
1307-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
1307+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
13081308
#[stable(feature = "pointer_methods", since = "1.26.0")]
13091309
#[inline]
13101310
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces

Diff for: library/core/src/ptr/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,6 @@ pub const unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
11761176
#[inline]
11771177
#[stable(feature = "rust1", since = "1.0.0")]
11781178
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
1179-
#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
11801179
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
11811180
#[rustc_diagnostic_item = "ptr_read"]
11821181
pub const unsafe fn read<T>(src: *const T) -> T {
@@ -1294,7 +1293,11 @@ pub const unsafe fn read<T>(src: *const T) -> T {
12941293
#[inline]
12951294
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
12961295
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
1297-
#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
1296+
#[rustc_allow_const_fn_unstable(
1297+
const_mut_refs,
1298+
const_maybe_uninit_as_mut_ptr,
1299+
const_intrinsic_copy
1300+
)]
12981301
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
12991302
#[rustc_diagnostic_item = "ptr_read_unaligned"]
13001303
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {

Diff for: library/core/src/ptr/mut_ptr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ impl<T: ?Sized> *mut T {
13851385
/// See [`ptr::copy`] for safety concerns and examples.
13861386
///
13871387
/// [`ptr::copy`]: crate::ptr::copy()
1388-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
1388+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
13891389
#[stable(feature = "pointer_methods", since = "1.26.0")]
13901390
#[inline(always)]
13911391
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1405,7 +1405,7 @@ impl<T: ?Sized> *mut T {
14051405
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
14061406
///
14071407
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
1408-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
1408+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
14091409
#[stable(feature = "pointer_methods", since = "1.26.0")]
14101410
#[inline(always)]
14111411
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1425,7 +1425,7 @@ impl<T: ?Sized> *mut T {
14251425
/// See [`ptr::copy`] for safety concerns and examples.
14261426
///
14271427
/// [`ptr::copy`]: crate::ptr::copy()
1428-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
1428+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
14291429
#[stable(feature = "pointer_methods", since = "1.26.0")]
14301430
#[inline(always)]
14311431
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1445,7 +1445,7 @@ impl<T: ?Sized> *mut T {
14451445
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
14461446
///
14471447
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
1448-
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
1448+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
14491449
#[stable(feature = "pointer_methods", since = "1.26.0")]
14501450
#[inline(always)]
14511451
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces

Diff for: library/core/tests/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#![feature(const_cell_into_inner)]
1515
#![feature(const_hash)]
1616
#![feature(const_heap)]
17+
#![feature(const_intrinsic_copy)]
1718
#![feature(const_maybe_uninit_as_mut_ptr)]
1819
#![feature(const_nonnull_new)]
1920
#![feature(const_pointer_is_aligned)]

Diff for: tests/ui/consts/const-eval/raw-pointer-ub.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_mut_refs)]
1+
#![feature(const_mut_refs, const_intrinsic_copy)]
22

33

44
const MISALIGNED_LOAD: () = unsafe {

0 commit comments

Comments
 (0)