Rollup merge of #60678 - DutchGhost:master, r=scottmcm

Stabilize vecdeque_rotate

This PR stabilizes the vecdeque_rotate feature.
r? @scottmcm

Closes https://github.com/rust-lang/rust/issues/56686
This commit is contained in:
Mazdak Farrokhzad 2019-05-19 02:31:35 +02:00 committed by GitHub
commit dc7cbb697b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -1948,8 +1948,6 @@ impl<T> VecDeque<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(vecdeque_rotate)]
///
/// use std::collections::VecDeque; /// use std::collections::VecDeque;
/// ///
/// let mut buf: VecDeque<_> = (0..10).collect(); /// let mut buf: VecDeque<_> = (0..10).collect();
@ -1963,7 +1961,7 @@ impl<T> VecDeque<T> {
/// } /// }
/// assert_eq!(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); /// assert_eq!(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
/// ``` /// ```
#[unstable(feature = "vecdeque_rotate", issue = "56686")] #[stable(feature = "vecdeque_rotate", since = "1.36.0")]
pub fn rotate_left(&mut self, mid: usize) { pub fn rotate_left(&mut self, mid: usize) {
assert!(mid <= self.len()); assert!(mid <= self.len());
let k = self.len() - mid; let k = self.len() - mid;
@ -1993,8 +1991,6 @@ impl<T> VecDeque<T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(vecdeque_rotate)]
///
/// use std::collections::VecDeque; /// use std::collections::VecDeque;
/// ///
/// let mut buf: VecDeque<_> = (0..10).collect(); /// let mut buf: VecDeque<_> = (0..10).collect();
@ -2008,7 +2004,7 @@ impl<T> VecDeque<T> {
/// } /// }
/// assert_eq!(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); /// assert_eq!(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
/// ``` /// ```
#[unstable(feature = "vecdeque_rotate", issue = "56686")] #[stable(feature = "vecdeque_rotate", since = "1.36.0")]
pub fn rotate_right(&mut self, k: usize) { pub fn rotate_right(&mut self, k: usize) {
assert!(k <= self.len()); assert!(k <= self.len());
let mid = self.len() - k; let mid = self.len() - k;

View File

@ -6,7 +6,6 @@
#![feature(repeat_generic_slice)] #![feature(repeat_generic_slice)]
#![feature(try_reserve)] #![feature(try_reserve)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(vecdeque_rotate)]
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};