Skip to content

Commit 6ac5384

Browse files
authored
Unrolled build for #142205
Rollup merge of #142205 - paolobarbolini:const_swap_with_slice-impl, r=Mark-Simulacrum Mark `slice::swap_with_slice` unstably const Tracking issue #142204
2 parents 383b9c4 + d9ca835 commit 6ac5384

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/slice/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3974,8 +3974,9 @@ impl<T> [T] {
39743974
///
39753975
/// [`split_at_mut`]: slice::split_at_mut
39763976
#[stable(feature = "swap_with_slice", since = "1.27.0")]
3977+
#[rustc_const_unstable(feature = "const_swap_with_slice", issue = "142204")]
39773978
#[track_caller]
3978-
pub fn swap_with_slice(&mut self, other: &mut [T]) {
3979+
pub const fn swap_with_slice(&mut self, other: &mut [T]) {
39793980
assert!(self.len() == other.len(), "destination and source slices have different lengths");
39803981
// SAFETY: `self` is valid for `self.len()` elements by definition, and `src` was
39813982
// checked to have the same length. The slices cannot overlap because

0 commit comments

Comments
 (0)