Skip to content

Commit 78a8c25

Browse files
committed
stabilize swap_with_slice feature
1 parent 41c211d commit 78a8c25

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/liballoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
#![feature(inclusive_range_fields)]
124124
#![cfg_attr(stage0, feature(generic_param_attrs))]
125125

126-
#![cfg_attr(not(test), feature(fn_traits, swap_with_slice, i128))]
126+
#![cfg_attr(not(test), feature(fn_traits, i128))]
127127
#![cfg_attr(test, feature(test))]
128128

129129
// Allow testing this library

src/liballoc/slice.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1702,8 +1702,6 @@ impl<T> [T] {
17021702
/// Swapping two elements across slices:
17031703
///
17041704
/// ```
1705-
/// #![feature(swap_with_slice)]
1706-
///
17071705
/// let mut slice1 = [0, 0];
17081706
/// let mut slice2 = [1, 2, 3, 4];
17091707
///
@@ -1719,8 +1717,6 @@ impl<T> [T] {
17191717
/// a compile failure:
17201718
///
17211719
/// ```compile_fail
1722-
/// #![feature(swap_with_slice)]
1723-
///
17241720
/// let mut slice = [1, 2, 3, 4, 5];
17251721
/// slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
17261722
/// ```
@@ -1729,8 +1725,6 @@ impl<T> [T] {
17291725
/// mutable sub-slices from a slice:
17301726
///
17311727
/// ```
1732-
/// #![feature(swap_with_slice)]
1733-
///
17341728
/// let mut slice = [1, 2, 3, 4, 5];
17351729
///
17361730
/// {
@@ -1742,7 +1736,7 @@ impl<T> [T] {
17421736
/// ```
17431737
///
17441738
/// [`split_at_mut`]: #method.split_at_mut
1745-
#[unstable(feature = "swap_with_slice", issue = "44030")]
1739+
#[stable(feature = "swap_with_slice", since = "1.27.0")]
17461740
pub fn swap_with_slice(&mut self, other: &mut [T]) {
17471741
core_slice::SliceExt::swap_with_slice(self, other)
17481742
}

src/libcore/slice/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub trait SliceExt {
223223
#[stable(feature = "copy_from_slice", since = "1.9.0")]
224224
fn copy_from_slice(&mut self, src: &[Self::Item]) where Self::Item: Copy;
225225

226-
#[unstable(feature = "swap_with_slice", issue = "44030")]
226+
#[stable(feature = "swap_with_slice", since = "1.27.0")]
227227
fn swap_with_slice(&mut self, src: &mut [Self::Item]);
228228

229229
#[stable(feature = "sort_unstable", since = "1.20.0")]

0 commit comments

Comments
 (0)