Skip to content

Commit b1a6c8b

Browse files
committed
Stabilize [T]::rotate_{left,right}
#41891
1 parent b1f8e6f commit b1a6c8b

File tree

6 files changed

+5
-23
lines changed

6 files changed

+5
-23
lines changed

src/liballoc/benches/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(i128_type)]
1414
#![feature(rand)]
1515
#![feature(repr_simd)]
16-
#![feature(slice_rotate)]
1716
#![feature(test)]
1817

1918
extern crate rand;

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
#![cfg_attr(test, feature(placement_in))]
8080
#![cfg_attr(not(test), feature(core_float))]
8181
#![cfg_attr(not(test), feature(exact_size_is_empty))]
82-
#![cfg_attr(not(test), feature(slice_rotate))]
8382
#![cfg_attr(not(test), feature(generator_trait))]
8483
#![cfg_attr(test, feature(rand, test))]
8584
#![feature(allow_internal_unstable)]

src/liballoc/slice.rs

+3-17
Original file line numberDiff line numberDiff line change
@@ -1460,8 +1460,6 @@ impl<T> [T] {
14601460
/// # Examples
14611461
///
14621462
/// ```
1463-
/// #![feature(slice_rotate)]
1464-
///
14651463
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
14661464
/// a.rotate_left(2);
14671465
/// assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
@@ -1470,23 +1468,15 @@ impl<T> [T] {
14701468
/// Rotating a subslice:
14711469
///
14721470
/// ```
1473-
/// #![feature(slice_rotate)]
1474-
///
14751471
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
14761472
/// a[1..5].rotate_left(1);
14771473
/// assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
1478-
/// ```
1479-
#[unstable(feature = "slice_rotate", issue = "41891")]
1474+
/// ```
1475+
#[stable(feature = "slice_rotate", since = "1.26.0")]
14801476
pub fn rotate_left(&mut self, mid: usize) {
14811477
core_slice::SliceExt::rotate_left(self, mid);
14821478
}
14831479

1484-
#[unstable(feature = "slice_rotate", issue = "41891")]
1485-
#[rustc_deprecated(since = "", reason = "renamed to `rotate_left`")]
1486-
pub fn rotate(&mut self, mid: usize) {
1487-
core_slice::SliceExt::rotate_left(self, mid);
1488-
}
1489-
14901480
/// Rotates the slice in-place such that the first `self.len() - k`
14911481
/// elements of the slice move to the end while the last `k` elements move
14921482
/// to the front. After calling `rotate_right`, the element previously at
@@ -1505,8 +1495,6 @@ impl<T> [T] {
15051495
/// # Examples
15061496
///
15071497
/// ```
1508-
/// #![feature(slice_rotate)]
1509-
///
15101498
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
15111499
/// a.rotate_right(2);
15121500
/// assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
@@ -1515,13 +1503,11 @@ impl<T> [T] {
15151503
/// Rotate a subslice:
15161504
///
15171505
/// ```
1518-
/// #![feature(slice_rotate)]
1519-
///
15201506
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
15211507
/// a[1..5].rotate_right(1);
15221508
/// assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
15231509
/// ```
1524-
#[unstable(feature = "slice_rotate", issue = "41891")]
1510+
#[stable(feature = "slice_rotate", since = "1.26.0")]
15251511
pub fn rotate_right(&mut self, k: usize) {
15261512
core_slice::SliceExt::rotate_right(self, k);
15271513
}

src/liballoc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![feature(pattern)]
2424
#![feature(placement_in_syntax)]
2525
#![feature(rand)]
26-
#![feature(slice_rotate)]
2726
#![feature(splice)]
2827
#![feature(str_escape)]
2928
#![feature(string_retain)]

src/libcore/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ pub trait SliceExt {
211211
#[stable(feature = "core", since = "1.6.0")]
212212
fn ends_with(&self, needle: &[Self::Item]) -> bool where Self::Item: PartialEq;
213213

214-
#[unstable(feature = "slice_rotate", issue = "41891")]
214+
#[stable(feature = "slice_rotate", since = "1.26.0")]
215215
fn rotate_left(&mut self, mid: usize);
216216

217-
#[unstable(feature = "slice_rotate", issue = "41891")]
217+
#[stable(feature = "slice_rotate", since = "1.26.0")]
218218
fn rotate_right(&mut self, k: usize);
219219

220220
#[stable(feature = "clone_from_slice", since = "1.7.0")]

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#![feature(refcell_replace_swap)]
3636
#![feature(sip_hash_13)]
3737
#![feature(slice_patterns)]
38-
#![feature(slice_rotate)]
3938
#![feature(sort_internals)]
4039
#![feature(specialization)]
4140
#![feature(step_trait)]

0 commit comments

Comments
 (0)