Skip to content

Commit 52c63eb

Browse files
authored
Unrolled build for #146841
Rollup merge of #146841 - bjoernager:const-slice-rotate, r=Amanieu Stabilise `rotate_left` and `rotate_right` in `[_]` as `const fn` items. Tracking issue: #143812 Closes: #143812 This PR stabilises the `const_slice_rotate` feature: ```rust impl<T> [T] { pub const fn rotate_left(&mut self, mid: usize); pub const fn rotate_right(&mut self, k: usize); } ``` No blockers or unresolved questions. FCP required. Courtesy of `@okaneco.`
2 parents 235a4c0 + 039fcdf commit 52c63eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/slice/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3629,7 +3629,7 @@ impl<T> [T] {
36293629
/// assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
36303630
/// ```
36313631
#[stable(feature = "slice_rotate", since = "1.26.0")]
3632-
#[rustc_const_unstable(feature = "const_slice_rotate", issue = "143812")]
3632+
#[rustc_const_stable(feature = "const_slice_rotate", since = "CURRENT_RUSTC_VERSION")]
36333633
pub const fn rotate_left(&mut self, mid: usize) {
36343634
assert!(mid <= self.len());
36353635
let k = self.len() - mid;
@@ -3675,7 +3675,7 @@ impl<T> [T] {
36753675
/// assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
36763676
/// ```
36773677
#[stable(feature = "slice_rotate", since = "1.26.0")]
3678-
#[rustc_const_unstable(feature = "const_slice_rotate", issue = "143812")]
3678+
#[rustc_const_stable(feature = "const_slice_rotate", since = "CURRENT_RUSTC_VERSION")]
36793679
pub const fn rotate_right(&mut self, k: usize) {
36803680
assert!(k <= self.len());
36813681
let mid = self.len() - k;

0 commit comments

Comments
 (0)