Skip to content

Add missing stability attributes to VecDeque. #28146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/libcollections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// #![feature(collections)]
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque;
///
Expand All @@ -387,6 +387,9 @@ impl<T> VecDeque<T> {
/// buf.shrink_to_fit();
/// assert!(buf.capacity() >= 4);
/// ```
#[unstable(feature = "deque_extras",
reason = "needs to be audited",
issue = "27788")]
pub fn shrink_to_fit(&mut self) {
// +1 since the ringbuffer always leaves one space empty
// len + 1 can't overflow for an existing, well-formed ringbuffer.
Expand Down Expand Up @@ -928,7 +931,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
/// ```
/// #![feature(collections)]
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque;
///
Expand All @@ -938,6 +941,9 @@ impl<T> VecDeque<T> {
/// buf.insert(1, 11);
/// assert_eq!(Some(&11), buf.get(1));
/// ```
#[unstable(feature = "deque_extras",
reason = "needs to be audited",
issue = "27788")]
pub fn insert(&mut self, index: usize, value: T) {
assert!(index <= self.len(), "index out of bounds");
if self.is_full() {
Expand Down