diff options
| author | Ralf Jung <post@ralfj.de> | 2024-11-30 09:57:19 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-11-30 10:12:30 +0100 |
| commit | ede5f0111d21b52f3f821455512d5c5b13fe9e29 (patch) | |
| tree | cab0a2c2cb28069e82a887fc4cf6333fafc6b5d1 | |
| parent | 23d9741be3bd6471689327ee4e58cd5d1967b760 (diff) | |
| download | rust-ede5f0111d21b52f3f821455512d5c5b13fe9e29.tar.gz rust-ede5f0111d21b52f3f821455512d5c5b13fe9e29.zip | |
move swap_nonoverlapping constness to separate feature gate
| -rw-r--r-- | library/core/src/ptr/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 6147e9f5e61..b6fc0caebd0 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -1009,6 +1009,7 @@ pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_swap", issue = "83163")] #[rustc_diagnostic_item = "ptr_swap"] +#[rustc_const_stable_indirect] pub const unsafe fn swap<T>(x: *mut T, y: *mut T) { // Give ourselves some scratch space to work with. // 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) { /// ``` #[inline] #[stable(feature = "swap_nonoverlapping", since = "1.27.0")] -#[rustc_const_unstable(feature = "const_swap", issue = "83163")] +#[rustc_const_unstable(feature = "const_swap_nonoverlapping", issue = "133668")] #[rustc_diagnostic_item = "ptr_swap_nonoverlapping"] pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { #[allow(unused)] @@ -1129,7 +1130,6 @@ pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { /// LLVM can vectorize this (at least it can for the power-of-two-sized types /// `swap_nonoverlapping` tries to use) so no need to manually SIMD it. #[inline] -#[rustc_const_unstable(feature = "const_swap", issue = "83163")] const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, count: usize) { let x = x.cast::<MaybeUninit<T>>(); let y = y.cast::<MaybeUninit<T>>(); |
