Skip to content

Commit cf0eef5

Browse files
RalfJunggitbot
authored and
gitbot
committed
move swap_nonoverlapping constness to separate feature gate
1 parent 0306414 commit cf0eef5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,7 @@ pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
10091009
#[stable(feature = "rust1", since = "1.0.0")]
10101010
#[rustc_const_unstable(feature = "const_swap", issue = "83163")]
10111011
#[rustc_diagnostic_item = "ptr_swap"]
1012+
#[rustc_const_stable_indirect]
10121013
pub const unsafe fn swap<T>(x: *mut T, y: *mut T) {
10131014
// Give ourselves some scratch space to work with.
10141015
// We do not have to worry about drops: `MaybeUninit` does nothing when dropped.
@@ -1069,7 +1070,7 @@ pub const unsafe fn swap<T>(x: *mut T, y: *mut T) {
10691070
/// ```
10701071
#[inline]
10711072
#[stable(feature = "swap_nonoverlapping", since = "1.27.0")]
1072-
#[rustc_const_unstable(feature = "const_swap", issue = "83163")]
1073+
#[rustc_const_unstable(feature = "const_swap_nonoverlapping", issue = "133668")]
10731074
#[rustc_diagnostic_item = "ptr_swap_nonoverlapping"]
10741075
pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
10751076
#[allow(unused)]
@@ -1129,7 +1130,6 @@ pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
11291130
/// LLVM can vectorize this (at least it can for the power-of-two-sized types
11301131
/// `swap_nonoverlapping` tries to use) so no need to manually SIMD it.
11311132
#[inline]
1132-
#[rustc_const_unstable(feature = "const_swap", issue = "83163")]
11331133
const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, count: usize) {
11341134
let x = x.cast::<MaybeUninit<T>>();
11351135
let y = y.cast::<MaybeUninit<T>>();

0 commit comments

Comments
 (0)