We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
slice::swap_with_slice
1 parent 244bbfc commit d9ca835Copy full SHA for d9ca835
library/core/src/slice/mod.rs
@@ -3927,8 +3927,9 @@ impl<T> [T] {
3927
///
3928
/// [`split_at_mut`]: slice::split_at_mut
3929
#[stable(feature = "swap_with_slice", since = "1.27.0")]
3930
+ #[rustc_const_unstable(feature = "const_swap_with_slice", issue = "142204")]
3931
#[track_caller]
- pub fn swap_with_slice(&mut self, other: &mut [T]) {
3932
+ pub const fn swap_with_slice(&mut self, other: &mut [T]) {
3933
assert!(self.len() == other.len(), "destination and source slices have different lengths");
3934
// SAFETY: `self` is valid for `self.len()` elements by definition, and `src` was
3935
// checked to have the same length. The slices cannot overlap because
0 commit comments