#[inline]
#[unstable(feature = "drain",
reason = "matches collection reform specification, \
- waiting for dust to settle")]
+ waiting for dust to settle",
+ issue = "27711")]
pub fn drain(&mut self) -> Drain<T> {
Drain { iter: self.data.drain(..) }
}
impl<T> ExactSizeIterator for IntoIter<T> {}
/// An iterator that drains a `BinaryHeap`.
-#[unstable(feature = "drain", reason = "recent addition")]
+#[unstable(feature = "drain", reason = "recent addition", issue = "27711")]
pub struct Drain<'a, T: 'a> {
iter: vec::Drain<'a, T>,
}
}
/// Trait for moving into a `Cow`.
-#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`")]
+#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`",
+ issue = "27735")]
pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
/// Moves `self` into `Cow`
fn into_cow(self) -> Cow<'a, B>;
/// Makes a new empty BTreeMap with the given B.
///
/// B cannot be less than 2.
+ #[unstable(feature = "btree_b",
+ reason = "probably want this to be on the type, eventually",
+ issue = "27795")]
pub fn with_b(b: usize) -> BTreeMap<K, V> {
assert!(b > 1, "B must be greater than 1");
BTreeMap {
/// assert_eq!(Some((&5, &"b")), map.range(Included(&4), Unbounded).next());
/// ```
#[unstable(feature = "btree_range",
- reason = "matches collection reform specification, waiting for dust to settle")]
+ reason = "matches collection reform specification, waiting for dust to settle",
+ issue = "27787")]
pub fn range<Min: ?Sized + Ord = K, Max: ?Sized + Ord = K>(&self, min: Bound<&Min>,
max: Bound<&Max>)
-> Range<K, V> where
/// }
/// ```
#[unstable(feature = "btree_range",
- reason = "matches collection reform specification, waiting for dust to settle")]
+ reason = "matches collection reform specification, waiting for dust to settle",
+ issue = "27787")]
pub fn range_mut<Min: ?Sized + Ord = K, Max: ?Sized + Ord = K>(&mut self, min: Bound<&Min>,
max: Bound<&Max>)
-> RangeMut<K, V> where
///
/// B cannot be less than 2.
#[unstable(feature = "btree_b",
- reason = "probably want this to be on the type, eventually")]
+ reason = "probably want this to be on the type, eventually",
+ issue = "27795")]
pub fn with_b(b: usize) -> BTreeSet<T> {
BTreeSet { map: BTreeMap::with_b(b) }
}
/// assert_eq!(Some(&5), set.range(Included(&4), Unbounded).next());
/// ```
#[unstable(feature = "btree_range",
- reason = "matches collection reform specification, waiting for dust to settle")]
+ reason = "matches collection reform specification, waiting for dust to settle",
+ issue = "27787")]
pub fn range<'a, Min: ?Sized + Ord = T, Max: ?Sized + Ord = T>(&'a self, min: Bound<&Min>,
max: Bound<&Max>)
-> Range<'a, T> where
#![unstable(feature = "enumset",
reason = "matches collection reform specification, \
- waiting for dust to settle")]
+ waiting for dust to settle",
+ issue = "0")]
use core::marker;
use core::fmt;
#![crate_type = "rlib"]
#![unstable(feature = "collections",
reason = "library is unlikely to be stabilized with the current \
- layout and name, use std::collections instead")]
+ layout and name, use std::collections instead",
+ issue = "27783")]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/",
}
/// An endpoint of a range of keys.
-#[unstable(feature = "collections_bound")]
+#[unstable(feature = "collections_bound", issue = "27711")]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub enum Bound<T> {
/// An inclusive bound.
/// ```
#[inline]
#[unstable(feature = "linked_list_extras",
- reason = "this is probably better handled by a cursor type -- we'll see")]
+ reason = "this is probably better handled by a cursor type -- we'll see",
+ issue = "27794")]
pub fn insert_next(&mut self, elt: A) {
self.insert_next_node(box Node::new(elt))
}
/// ```
#[inline]
#[unstable(feature = "linked_list_extras",
- reason = "this is probably better handled by a cursor type -- we'll see")]
+ reason = "this is probably better handled by a cursor type -- we'll see",
+ issue = "27794")]
pub fn peek_next(&mut self) -> Option<&mut A> {
if self.nelem == 0 {
return None
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![unstable(feature = "collections_range", reason = "was just added")]
+#![unstable(feature = "collections_range", reason = "was just added",
+ issue = "27711")]
//! Range syntax.
}
/// Returns the first and all the rest of the elements of a slice.
- #[unstable(feature = "slice_splits", reason = "new API")]
+ #[unstable(feature = "slice_splits", reason = "new API", issue = "27742")]
#[inline]
pub fn split_first(&self) -> Option<(&T, &[T])> {
core_slice::SliceExt::split_first(self)
}
/// Returns the first and all the rest of the elements of a slice.
- #[unstable(feature = "slice_splits", reason = "new API")]
+ #[unstable(feature = "slice_splits", reason = "new API", issue = "27742")]
#[inline]
pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> {
core_slice::SliceExt::split_first_mut(self)
}
/// Returns the last and all the rest of the elements of a slice.
- #[unstable(feature = "slice_splits", reason = "new API")]
+ #[unstable(feature = "slice_splits", reason = "new API", issue = "27742")]
#[inline]
pub fn split_last(&self) -> Option<(&T, &[T])> {
core_slice::SliceExt::split_last(self)
}
/// Returns the last and all the rest of the elements of a slice.
- #[unstable(feature = "slice_splits", since = "1.3.0")]
+ #[unstable(feature = "slice_splits", reason = "new API", issue = "27742")]
#[inline]
pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])> {
core_slice::SliceExt::split_last_mut(self)
/// assert!(dst.clone_from_slice(&src2) == 3);
/// assert!(dst == [3, 4, 5]);
/// ```
- #[unstable(feature = "clone_from_slice")]
+ #[unstable(feature = "clone_from_slice", issue = "27750")]
pub fn clone_from_slice(&mut self, src: &[T]) -> usize where T: Clone {
core_slice::SliceExt::clone_from_slice(self, src)
}
// Extension traits for slices over specific kinds of data
////////////////////////////////////////////////////////////////////////////////
#[unstable(feature = "slice_concat_ext",
- reason = "trait should not have to exist")]
+ reason = "trait should not have to exist",
+ issue = "27747")]
/// An extension trait for concatenating slices
pub trait SliceConcatExt<T: ?Sized> {
#[unstable(feature = "slice_concat_ext",
- reason = "trait should not have to exist")]
+ reason = "trait should not have to exist",
+ issue = "27747")]
/// The resulting type after concatenation
type Output;
///
/// For use with the `std::iter` module.
#[derive(Clone)]
-#[unstable(feature = "str_utf16")]
+#[unstable(feature = "str_utf16", issue = "27714")]
pub struct Utf16Units<'a> {
encoder: Utf16Encoder<Chars<'a>>
}
reason = "it is unclear whether this method pulls its weight \
with the existence of the char_indices iterator or \
this method may want to be replaced with checked \
- slicing")]
+ slicing",
+ issue = "27754")]
#[inline]
pub fn is_char_boundary(&self, index: usize) -> bool {
core_str::StrExt::is_char_boundary(self, index)
/// Takes a bytewise mutable slice from a string.
///
/// Same as `slice_unchecked`, but works with `&mut str` instead of `&str`.
- #[unstable(feature = "str_slice_mut", reason = "recently added")]
+ #[unstable(feature = "str_slice_mut", reason = "recently added",
+ issue = "27793")]
#[inline]
pub unsafe fn slice_mut_unchecked(&mut self, begin: usize, end: usize) -> &mut str {
core_str::StrExt::slice_mut_unchecked(self, begin, end)
#[unstable(feature = "str_char",
reason = "often replaced by char_indices, this method may \
be removed in favor of just char_at() or eventually \
- removed altogether")]
+ removed altogether",
+ issue = "27754")]
#[inline]
pub fn char_range_at(&self, start: usize) -> CharRange {
core_str::StrExt::char_range_at(self, start)
#[unstable(feature = "str_char",
reason = "often replaced by char_indices, this method may \
be removed in favor of just char_at_reverse() or \
- eventually removed altogether")]
+ eventually removed altogether",
+ issue = "27754")]
#[inline]
pub fn char_range_at_reverse(&self, start: usize) -> CharRange {
core_str::StrExt::char_range_at_reverse(self, start)
method may be removed or possibly renamed in the \
future; it is normally replaced by chars/char_indices \
iterators or by getting the first char from a \
- subslice")]
+ subslice",
+ issue = "27754")]
#[inline]
pub fn char_at(&self, i: usize) -> char {
core_str::StrExt::char_at(self, i)
#[unstable(feature = "str_char",
reason = "see char_at for more details, but reverse semantics \
are also somewhat unclear, especially with which \
- cases generate panics")]
+ cases generate panics",
+ issue = "27754")]
#[inline]
pub fn char_at_reverse(&self, i: usize) -> char {
core_str::StrExt::char_at_reverse(self, i)
#[unstable(feature = "str_char",
reason = "awaiting conventions about shifting and slices and \
may not be warranted with the existence of the chars \
- and/or char_indices iterators")]
+ and/or char_indices iterators",
+ issue = "27754")]
#[inline]
pub fn slice_shift_char(&self) -> Option<(char, &str)> {
core_str::StrExt::slice_shift_char(self)
/// assert_eq!(b, " 老虎 Léopard");
/// ```
#[inline]
- #[unstable(feature = "str_split_at", reason = "recently added")]
+ #[unstable(feature = "str_split_at", reason = "recently added",
+ issue = "27792")]
pub fn split_at(&self, mid: usize) -> (&str, &str) {
core_str::StrExt::split_at(self, mid)
}
/// Divide one mutable string slice into two at an index.
#[inline]
- #[unstable(feature = "str_split_at", reason = "recently added")]
+ #[unstable(feature = "str_split_at", reason = "recently added",
+ issue = "27792")]
pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str) {
core_str::StrExt::split_at_mut(self, mid)
}
/// Returns an iterator of `u16` over the string encoded as UTF-16.
#[unstable(feature = "str_utf16",
- reason = "this functionality may only be provided by libunicode")]
+ reason = "this functionality may only be provided by libunicode",
+ issue = "27714")]
pub fn utf16_units(&self) -> Utf16Units {
Utf16Units { encoder: Utf16Encoder::new(self[..].chars()) }
}
/// assert_eq!(v, [(0, 3)]); // only the first `aba`
/// ```
#[unstable(feature = "str_match_indices",
- reason = "might have its iterator type changed")]
+ reason = "might have its iterator type changed",
+ issue = "27743")]
// NB: Right now MatchIndices yields `(usize, usize)`, but it would
// be more consistent with `matches` and `char_indices` to return `(usize, &str)`
pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P> {
/// assert_eq!(v, [(2, 5)]); // only the last `aba`
/// ```
#[unstable(feature = "str_match_indices",
- reason = "might have its iterator type changed")]
+ reason = "might have its iterator type changed",
+ issue = "27743")]
// NB: Right now RMatchIndices yields `(usize, usize)`, but it would
// be more consistent with `rmatches` and `char_indices` to return `(usize, &str)`
pub fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P>
/// Escapes each char in `s` with `char::escape_default`.
#[unstable(feature = "str_escape",
- reason = "return type may change to be an iterator")]
+ reason = "return type may change to be an iterator",
+ issue = "27791")]
pub fn escape_default(&self) -> String {
self.chars().flat_map(|c| c.escape_default()).collect()
}
/// Escapes each char in `s` with `char::escape_unicode`.
#[unstable(feature = "str_escape",
- reason = "return type may change to be an iterator")]
+ reason = "return type may change to be an iterator",
+ issue = "27791")]
pub fn escape_unicode(&self) -> String {
self.chars().flat_map(|c| c.escape_unicode()).collect()
}
/// Converts the `Box<str>` into a `String` without copying or allocating.
#[unstable(feature = "box_str",
- reason = "recently added, matches RFC")]
+ reason = "recently added, matches RFC",
+ issue = "27785")]
pub fn into_string(self: Box<str>) -> String {
unsafe {
let slice = mem::transmute::<Box<str>, Box<[u8]>>(self);
/// Extracts a string slice containing the entire string.
#[inline]
#[unstable(feature = "convert",
- reason = "waiting on RFC revision")]
+ reason = "waiting on RFC revision",
+ issue = "27729")]
pub fn as_str(&self) -> &str {
self
}
/// assert_eq!(s, "");
/// ```
#[unstable(feature = "drain",
- reason = "recently added, matches RFC")]
+ reason = "recently added, matches RFC",
+ issue = "27711")]
pub fn drain<R>(&mut self, range: R) -> Drain where R: RangeArgument<usize> {
// Memory safety
//
///
/// Note that this will drop any excess capacity.
#[unstable(feature = "box_str",
- reason = "recently added, matches RFC")]
+ reason = "recently added, matches RFC",
+ issue = "27785")]
pub fn into_boxed_str(self) -> Box<str> {
let slice = self.vec.into_boxed_slice();
unsafe { mem::transmute::<Box<[u8]>, Box<str>>(slice) }
/// Error returned from `String::from`
#[unstable(feature = "str_parse_error", reason = "may want to be replaced with \
- Void if it ever exists")]
+ Void if it ever exists",
+ issue = "27734")]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct ParseError(());
}
}
-#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`")]
+#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`",
+ issue= "27735")]
impl IntoCow<'static, str> for String {
#[inline]
fn into_cow(self) -> Cow<'static, str> {
}
}
-#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`")]
+#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`",
+ issue = "27735")]
impl<'a> IntoCow<'a, str> for &'a str {
#[inline]
fn into_cow(self) -> Cow<'a, str> {
}
/// A draining iterator for `String`.
-#[unstable(feature = "drain", reason = "recently added")]
+#[unstable(feature = "drain", reason = "recently added", issue = "27711")]
pub struct Drain<'a> {
/// Will be used as &'a mut String in the destructor
string: *mut String,
unsafe impl<'a> Sync for Drain<'a> {}
unsafe impl<'a> Send for Drain<'a> {}
-#[unstable(feature = "drain", reason = "recently added")]
+#[unstable(feature = "drain", reason = "recently added", issue = "27711")]
impl<'a> Drop for Drain<'a> {
fn drop(&mut self) {
unsafe {
}
}
-#[unstable(feature = "drain", reason = "recently added")]
+#[unstable(feature = "drain", reason = "recently added", issue = "27711")]
impl<'a> Iterator for Drain<'a> {
type Item = char;
}
}
-#[unstable(feature = "drain", reason = "recently added")]
+#[unstable(feature = "drain", reason = "recently added", issue = "27711")]
impl<'a> DoubleEndedIterator for Drain<'a> {
#[inline]
fn next_back(&mut self) -> Option<char> {
/// Equivalent to `&s[..]`.
#[inline]
#[unstable(feature = "convert",
- reason = "waiting on RFC revision")]
+ reason = "waiting on RFC revision",
+ issue = "27729")]
pub fn as_slice(&self) -> &[T] {
self
}
/// Equivalent to `&mut s[..]`.
#[inline]
#[unstable(feature = "convert",
- reason = "waiting on RFC revision")]
+ reason = "waiting on RFC revision",
+ issue = "27729")]
pub fn as_mut_slice(&mut self) -> &mut [T] {
&mut self[..]
}
/// ```
#[inline]
#[unstable(feature = "append",
- reason = "new API, waiting for dust to settle")]
+ reason = "new API, waiting for dust to settle",
+ issue = "27765")]
pub fn append(&mut self, other: &mut Self) {
self.reserve(other.len());
let len = self.len();
/// assert_eq!(u, &[1, 2, 3]);
/// ```
#[unstable(feature = "drain",
- reason = "recently added, matches RFC")]
+ reason = "recently added, matches RFC",
+ issue = "27711")]
pub fn drain<R>(&mut self, range: R) -> Drain<T> where R: RangeArgument<usize> {
// Memory safety
//
/// ```
#[inline]
#[unstable(feature = "split_off",
- reason = "new API, waiting for dust to settle")]
+ reason = "new API, waiting for dust to settle",
+ issue = "27766")]
pub fn split_off(&mut self, at: usize) -> Self {
assert!(at <= self.len(), "`at` out of bounds");
/// assert_eq!(vec, [1, 2]);
/// ```
#[unstable(feature = "vec_resize",
- reason = "matches collection reform specification; waiting for dust to settle")]
+ reason = "matches collection reform specification; waiting for dust to settle",
+ issue = "27790")]
pub fn resize(&mut self, new_len: usize, value: T) {
let len = self.len();
/// ```
#[inline]
#[unstable(feature = "vec_push_all",
- reason = "likely to be replaced by a more optimized extend")]
+ reason = "likely to be replaced by a more optimized extend",
+ issue = "27744")]
pub fn push_all(&mut self, other: &[T]) {
self.reserve(other.len());
}
/// A draining iterator for `Vec<T>`.
-#[unstable(feature = "drain", reason = "recently added")]
+#[unstable(feature = "drain", reason = "recently added", issue = "27711")]
pub struct Drain<'a, T: 'a> {
/// Index of tail to preserve
tail_start: usize,
/// assert_eq!(Some(&5), buf.get(0));
/// ```
#[unstable(feature = "deque_extras",
- reason = "matches collection reform specification; waiting on panic semantics")]
+ reason = "matches collection reform specification; waiting on panic semantics",
+ issue = "27788")]
pub fn truncate(&mut self, len: usize) {
for _ in len..self.len() {
self.pop_back();
/// `VecDeque`.
#[inline]
#[unstable(feature = "deque_extras",
- reason = "matches collection reform specification, waiting for dust to settle")]
+ reason = "matches collection reform specification, waiting for dust to settle",
+ issue = "27788")]
pub fn as_slices(&self) -> (&[T], &[T]) {
unsafe {
let contiguous = self.is_contiguous();
/// `VecDeque`.
#[inline]
#[unstable(feature = "deque_extras",
- reason = "matches collection reform specification, waiting for dust to settle")]
+ reason = "matches collection reform specification, waiting for dust to settle",
+ issue = "27788")]
pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T]) {
unsafe {
let contiguous = self.is_contiguous();
/// ```
#[inline]
#[unstable(feature = "drain",
- reason = "matches collection reform specification, waiting for dust to settle")]
+ reason = "matches collection reform specification, waiting for dust to settle",
+ issue = "27711")]
pub fn drain(&mut self) -> Drain<T> {
Drain {
inner: self,
/// assert_eq!(buf[1], 2);
/// ```
#[unstable(feature = "deque_extras",
- reason = "the naming of this function may be altered")]
+ reason = "the naming of this function may be altered",
+ issue = "27788")]
pub fn swap_back_remove(&mut self, index: usize) -> Option<T> {
let length = self.len();
if length > 0 && index < length - 1 {
/// assert_eq!(buf[1], 1);
/// ```
#[unstable(feature = "deque_extras",
- reason = "the naming of this function may be altered")]
+ reason = "the naming of this function may be altered",
+ issue = "27788")]
pub fn swap_front_remove(&mut self, index: usize) -> Option<T> {
let length = self.len();
if length > 0 && index < length && index != 0 {
/// ```
#[inline]
#[unstable(feature = "split_off",
- reason = "new API, waiting for dust to settle")]
+ reason = "new API, waiting for dust to settle",
+ issue = "27766")]
pub fn split_off(&mut self, at: usize) -> Self {
let len = self.len();
assert!(at <= len, "`at` out of bounds");
/// ```
#[inline]
#[unstable(feature = "append",
- reason = "new API, waiting for dust to settle")]
+ reason = "new API, waiting for dust to settle",
+ issue = "27765")]
pub fn append(&mut self, other: &mut Self) {
// naive impl
self.extend(other.drain());
/// assert_eq!(&v[..], &[2, 4]);
/// ```
#[unstable(feature = "vec_deque_retain",
- reason = "new API, waiting for dust to settle")]
+ reason = "new API, waiting for dust to settle",
+ issue = "27767")]
pub fn retain<F>(&mut self, mut f: F) where F: FnMut(&T) -> bool {
let len = self.len();
let mut del = 0;
/// }
/// ```
#[unstable(feature = "deque_extras",
- reason = "matches collection reform specification; waiting on panic semantics")]
+ reason = "matches collection reform specification; waiting on panic semantics",
+ issue = "27788")]
pub fn resize(&mut self, new_len: usize, value: T) {
let len = self.len();
/// A draining VecDeque iterator
#[unstable(feature = "drain",
- reason = "matches collection reform specification, waiting for dust to settle")]
+ reason = "matches collection reform specification, waiting for dust to settle",
+ issue = "27711")]
pub struct Drain<'a, T: 'a> {
inner: &'a mut VecDeque<T>,
}