stabilize swap_with_slice
feature
This commit is contained in:
parent
41c211d204
commit
78a8c25703
@ -123,7 +123,7 @@
|
||||
#![feature(inclusive_range_fields)]
|
||||
#![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))]
|
||||
|
||||
// Allow testing this library
|
||||
|
@ -1702,8 +1702,6 @@ impl<T> [T] {
|
||||
/// Swapping two elements across slices:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(swap_with_slice)]
|
||||
///
|
||||
/// let mut slice1 = [0, 0];
|
||||
/// let mut slice2 = [1, 2, 3, 4];
|
||||
///
|
||||
@ -1719,8 +1717,6 @@ impl<T> [T] {
|
||||
/// a compile failure:
|
||||
///
|
||||
/// ```compile_fail
|
||||
/// #![feature(swap_with_slice)]
|
||||
///
|
||||
/// let mut slice = [1, 2, 3, 4, 5];
|
||||
/// slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
|
||||
/// ```
|
||||
@ -1729,8 +1725,6 @@ impl<T> [T] {
|
||||
/// mutable sub-slices from a slice:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(swap_with_slice)]
|
||||
///
|
||||
/// let mut slice = [1, 2, 3, 4, 5];
|
||||
///
|
||||
/// {
|
||||
@ -1742,7 +1736,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
///
|
||||
/// [`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]) {
|
||||
core_slice::SliceExt::swap_with_slice(self, other)
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ pub trait SliceExt {
|
||||
#[stable(feature = "copy_from_slice", since = "1.9.0")]
|
||||
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]);
|
||||
|
||||
#[stable(feature = "sort_unstable", since = "1.20.0")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user