1
Fork 0

stabilize swap_with_slice feature

This commit is contained in:
tinaun 2018-04-17 00:40:07 -04:00
parent 41c211d204
commit 78a8c25703
3 changed files with 3 additions and 9 deletions

View file

@ -123,7 +123,7 @@
#![feature(inclusive_range_fields)] #![feature(inclusive_range_fields)]
#![cfg_attr(stage0, feature(generic_param_attrs))] #![cfg_attr(stage0, feature(generic_param_attrs))]
#![cfg_attr(not(test), feature(fn_traits, swap_with_slice, i128))] #![cfg_attr(not(test), feature(fn_traits, i128))]
#![cfg_attr(test, feature(test))] #![cfg_attr(test, feature(test))]
// Allow testing this library // Allow testing this library

View file

@ -1702,8 +1702,6 @@ impl<T> [T] {
/// Swapping two elements across slices: /// Swapping two elements across slices:
/// ///
/// ``` /// ```
/// #![feature(swap_with_slice)]
///
/// let mut slice1 = [0, 0]; /// let mut slice1 = [0, 0];
/// let mut slice2 = [1, 2, 3, 4]; /// let mut slice2 = [1, 2, 3, 4];
/// ///
@ -1719,8 +1717,6 @@ impl<T> [T] {
/// a compile failure: /// a compile failure:
/// ///
/// ```compile_fail /// ```compile_fail
/// #![feature(swap_with_slice)]
///
/// let mut slice = [1, 2, 3, 4, 5]; /// let mut slice = [1, 2, 3, 4, 5];
/// slice[..2].swap_with_slice(&mut slice[3..]); // compile fail! /// slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
/// ``` /// ```
@ -1729,8 +1725,6 @@ impl<T> [T] {
/// mutable sub-slices from a slice: /// mutable sub-slices from a slice:
/// ///
/// ``` /// ```
/// #![feature(swap_with_slice)]
///
/// let mut slice = [1, 2, 3, 4, 5]; /// let mut slice = [1, 2, 3, 4, 5];
/// ///
/// { /// {
@ -1742,7 +1736,7 @@ impl<T> [T] {
/// ``` /// ```
/// ///
/// [`split_at_mut`]: #method.split_at_mut /// [`split_at_mut`]: #method.split_at_mut
#[unstable(feature = "swap_with_slice", issue = "44030")] #[stable(feature = "swap_with_slice", since = "1.27.0")]
pub fn swap_with_slice(&mut self, other: &mut [T]) { pub fn swap_with_slice(&mut self, other: &mut [T]) {
core_slice::SliceExt::swap_with_slice(self, other) core_slice::SliceExt::swap_with_slice(self, other)
} }

View file

@ -223,7 +223,7 @@ pub trait SliceExt {
#[stable(feature = "copy_from_slice", since = "1.9.0")] #[stable(feature = "copy_from_slice", since = "1.9.0")]
fn copy_from_slice(&mut self, src: &[Self::Item]) where Self::Item: Copy; fn copy_from_slice(&mut self, src: &[Self::Item]) where Self::Item: Copy;
#[unstable(feature = "swap_with_slice", issue = "44030")] #[stable(feature = "swap_with_slice", since = "1.27.0")]
fn swap_with_slice(&mut self, src: &mut [Self::Item]); fn swap_with_slice(&mut self, src: &mut [Self::Item]);
#[stable(feature = "sort_unstable", since = "1.20.0")] #[stable(feature = "sort_unstable", since = "1.20.0")]