From d444d0c357e85c90e73585520e2da74304c7265a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 9 Jun 2015 14:39:23 -0700 Subject: [PATCH] collections: Split the `collections` feature This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules. --- src/libcollections/binary_heap.rs | 16 ++++++----- src/libcollections/bit.rs | 40 +++++++++++++------------- src/libcollections/btree/map.rs | 4 +-- src/libcollections/btree/set.rs | 4 +-- src/libcollections/enum_set.rs | 37 +++++++----------------- src/libcollections/lib.rs | 15 ++++++---- src/libcollections/linked_list.rs | 4 +-- src/libcollections/range.rs | 1 + src/libcollections/slice.rs | 48 +++++++++++++++++-------------- src/libcollections/str.rs | 20 ++++++------- src/libcollections/string.rs | 19 ++++++++---- src/libcollections/vec.rs | 33 ++++++++++++++------- src/libcollections/vec_deque.rs | 20 ++++++------- src/libcollections/vec_map.rs | 20 +++++++------ src/libgraphviz/lib.rs | 3 +- src/librustc/lib.rs | 8 ++++++ src/librustc_back/lib.rs | 2 +- src/librustc_driver/lib.rs | 7 +++-- src/librustc_lint/lib.rs | 4 +-- src/librustc_llvm/lib.rs | 2 +- src/librustc_resolve/lib.rs | 2 +- src/librustc_trans/lib.rs | 2 +- src/librustc_typeck/lib.rs | 4 ++- src/librustc_unicode/char.rs | 12 ++++++-- src/libserialize/lib.rs | 2 ++ src/libstd/lib.rs | 5 ++++ src/libsyntax/lib.rs | 6 ++-- src/libterm/lib.rs | 4 +-- src/libtest/lib.rs | 2 +- src/rustbook/main.rs | 6 ++-- 30 files changed, 197 insertions(+), 155 deletions(-) diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs index 451b1fd61cb..f6204173ed7 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -10,10 +10,11 @@ //! A priority queue implemented with a binary heap. //! -//! Insertion and popping the largest element have `O(log n)` time complexity. Checking the largest -//! element is `O(1)`. Converting a vector to a binary heap can be done in-place, and has `O(n)` -//! complexity. A binary heap can also be converted to a sorted vector in-place, allowing it to -//! be used for an `O(n log n)` in-place heapsort. +//! Insertion and popping the largest element have `O(log n)` time complexity. +//! Checking the largest element is `O(1)`. Converting a vector to a binary heap +//! can be done in-place, and has `O(n)` complexity. A binary heap can also be +//! converted to a sorted vector in-place, allowing it to be used for an `O(n +//! log n)` in-place heapsort. //! //! # Examples //! @@ -539,8 +540,9 @@ impl BinaryHeap { /// /// The elements are removed in arbitrary order. #[inline] - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] + #[unstable(feature = "drain", + reason = "matches collection reform specification, \ + waiting for dust to settle")] pub fn drain(&mut self) -> Drain { Drain { iter: self.data.drain(..) } } @@ -678,7 +680,7 @@ impl DoubleEndedIterator for IntoIter { impl ExactSizeIterator for IntoIter {} /// An iterator that drains a `BinaryHeap`. -#[unstable(feature = "collections", reason = "recent addition")] +#[unstable(feature = "drain", reason = "recent addition")] pub struct Drain<'a, T: 'a> { iter: vec::Drain<'a, T>, } diff --git a/src/libcollections/bit.rs b/src/libcollections/bit.rs index 562bbe26206..5709ed7a294 100644 --- a/src/libcollections/bit.rs +++ b/src/libcollections/bit.rs @@ -156,8 +156,7 @@ const FALSE: &'static bool = &false; /// println!("{:?}", bv); /// println!("total bits set to true: {}", bv.iter().filter(|x| *x).count()); /// ``` -#[unstable(feature = "collections", - reason = "RFC 509")] +#[unstable(feature = "bitvec", reason = "RFC 509")] pub struct BitVec { /// Internal representation of the bit vector storage: Vec, @@ -181,14 +180,16 @@ impl Index for BitVec { /// Computes how many blocks are needed to store that many bits fn blocks_for_bits(bits: usize) -> usize { - // If we want 17 bits, dividing by 32 will produce 0. So we add 1 to make sure we - // reserve enough. But if we want exactly a multiple of 32, this will actually allocate - // one too many. So we need to check if that's the case. We can do that by computing if - // bitwise AND by `32 - 1` is 0. But LLVM should be able to optimize the semantically - // superior modulo operator on a power of two to this. + // If we want 17 bits, dividing by 32 will produce 0. So we add 1 to make + // sure we reserve enough. But if we want exactly a multiple of 32, this + // will actually allocate one too many. So we need to check if that's the + // case. We can do that by computing if bitwise AND by `32 - 1` is 0. But + // LLVM should be able to optimize the semantically superior modulo operator + // on a power of two to this. // // Note that we can technically avoid this branch with the expression - // `(nbits + u32::BITS - 1) / 32::BITS`, but if nbits is almost usize::MAX this will overflow. + // `(nbits + u32::BITS - 1) / 32::BITS`, but if nbits is almost usize::MAX + // this will overflow. if bits % u32::BITS == 0 { bits / u32::BITS } else { @@ -202,6 +203,7 @@ fn mask_for_bits(bits: usize) -> u32 { !0 >> (u32::BITS - bits % u32::BITS) % u32::BITS } +#[unstable(feature = "bitvec", reason = "RFC 509")] impl BitVec { /// Applies the given operation to the blocks of self and other, and sets /// self to be the result. This relies on the caller not to corrupt the @@ -407,8 +409,6 @@ impl BitVec { /// assert_eq!(bv[3], true); /// ``` #[inline] - #[unstable(feature = "collections", - reason = "panic semantics are likely to change in the future")] pub fn set(&mut self, i: usize, x: bool) { assert!(i < self.nbits); let w = i / u32::BITS; @@ -608,7 +608,7 @@ impl BitVec { /// # Examples /// /// ``` - /// # #![feature(collections, bit_vec_append_split_off)] + /// # #![feature(bitvec, append)] /// use std::collections::BitVec; /// /// let mut a = BitVec::from_bytes(&[0b10000000]); @@ -621,7 +621,7 @@ impl BitVec { /// assert!(a.eq_vec(&[true, false, false, false, false, false, false, false, /// false, true, true, false, false, false, false, true])); /// ``` - #[unstable(feature = "bit_vec_append_split_off", + #[unstable(feature = "append", reason = "recently added as part of collections reform 2")] pub fn append(&mut self, other: &mut Self) { let b = self.len() % u32::BITS; @@ -651,7 +651,7 @@ impl BitVec { /// # Examples /// /// ``` - /// # #![feature(collections, bit_vec_append_split_off)] + /// # #![feature(bitvec, split_off)] /// use std::collections::BitVec; /// let mut a = BitVec::new(); /// a.push(true); @@ -666,7 +666,7 @@ impl BitVec { /// assert!(a.eq_vec(&[true, false])); /// assert!(b.eq_vec(&[false, true])); /// ``` - #[unstable(feature = "bit_vec_append_split_off", + #[unstable(feature = "split_off", reason = "recently added as part of collections reform 2")] pub fn split_off(&mut self, at: usize) -> Self { assert!(at <= self.len(), "`at` out of bounds"); @@ -1254,8 +1254,7 @@ impl<'a> IntoIterator for &'a BitVec { /// assert!(bv[3]); /// ``` #[derive(Clone)] -#[unstable(feature = "collections", - reason = "RFC 509")] +#[unstable(feature = "bitset", reason = "RFC 509")] pub struct BitSet { bit_vec: BitVec, } @@ -1322,6 +1321,7 @@ impl cmp::PartialEq for BitSet { #[stable(feature = "rust1", since = "1.0.0")] impl cmp::Eq for BitSet {} +#[unstable(feature = "bitset", reason = "RFC 509")] impl BitSet { /// Creates a new empty `BitSet`. /// @@ -1808,7 +1808,7 @@ impl BitSet { /// # Examples /// /// ``` - /// # #![feature(collections, bit_set_append_split_off)] + /// # #![feature(collections, append)] /// use std::collections::{BitVec, BitSet}; /// /// let mut a = BitSet::new(); @@ -1826,7 +1826,7 @@ impl BitSet { /// assert_eq!(b.len(), 0); /// assert_eq!(a, BitSet::from_bit_vec(BitVec::from_bytes(&[0b01110010]))); /// ``` - #[unstable(feature = "bit_set_append_split_off", + #[unstable(feature = "append", reason = "recently added as part of collections reform 2")] pub fn append(&mut self, other: &mut Self) { self.union_with(other); @@ -1839,7 +1839,7 @@ impl BitSet { /// # Examples /// /// ``` - /// # #![feature(collections, bit_set_append_split_off)] + /// # #![feature(bitset, split_off)] /// use std::collections::{BitSet, BitVec}; /// let mut a = BitSet::new(); /// a.insert(2); @@ -1854,7 +1854,7 @@ impl BitSet { /// assert_eq!(a, BitSet::from_bit_vec(BitVec::from_bytes(&[0b01100000]))); /// assert_eq!(b, BitSet::from_bit_vec(BitVec::from_bytes(&[0b00010010]))); /// ``` - #[unstable(feature = "bit_set_append_split_off", + #[unstable(feature = "split_off", reason = "recently added as part of collections reform 2")] pub fn split_off(&mut self, at: usize) -> Self { let mut other = BitSet::new(); diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 314036ef59d..127f470c9aa 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -1520,7 +1520,7 @@ impl BTreeMap { /// } /// assert_eq!(Some((&5, &"b")), map.range(Included(&4), Unbounded).next()); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "btree_range", reason = "matches collection reform specification, waiting for dust to settle")] pub fn range<'a>(&'a self, min: Bound<&K>, max: Bound<&K>) -> Range<'a, K, V> { range_impl!(&self.root, min, max, as_slices_internal, iter, Range, edges, []) @@ -1548,7 +1548,7 @@ impl BTreeMap { /// println!("{} => {}", name, balance); /// } /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "btree_range", reason = "matches collection reform specification, waiting for dust to settle")] pub fn range_mut<'a>(&'a mut self, min: Bound<&K>, max: Bound<&K>) -> RangeMut<'a, K, V> { range_impl!(&mut self.root, min, max, as_slices_internal_mut, iter_mut, RangeMut, diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index ec6c5e63e2d..5914e2f296a 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -102,7 +102,7 @@ impl BTreeSet { /// Makes a new BTreeSet with the given B. /// /// B cannot be less than 2. - #[unstable(feature = "collections", + #[unstable(feature = "btree_b", reason = "probably want this to be on the type, eventually")] pub fn with_b(b: usize) -> BTreeSet { BTreeSet { map: BTreeMap::with_b(b) } @@ -154,7 +154,7 @@ impl BTreeSet { /// } /// assert_eq!(Some(&5), set.range(Included(&4), Unbounded).next()); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "btree_range", reason = "matches collection reform specification, waiting for dust to settle")] pub fn range<'a>(&'a self, min: Bound<&T>, max: Bound<&T>) -> Range<'a, T> { fn first((a, _): (A, B)) -> A { a } diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index ad90f9f1caa..e90e6c065a2 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -13,21 +13,26 @@ //! This module defines a container which uses an efficient bit mask //! representation to hold C-like enum variants. +#![unstable(feature = "enumset", + reason = "matches collection reform specification, \ + waiting for dust to settle")] + use core::prelude::*; use core::marker; use core::fmt; use core::iter::{FromIterator}; use core::ops::{Sub, BitOr, BitAnd, BitXor}; -// FIXME(contentions): implement union family of methods? (general design may be wrong here) +// FIXME(contentions): implement union family of methods? (general design may be +// wrong here) -#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)] /// A specialized set implementation to use enum types. /// -/// It is a logic error for an item to be modified in such a way that the transformation of the -/// item to or from a `usize`, as determined by the `CLike` trait, changes while the item is in the -/// set. This is normally only possible through `Cell`, `RefCell`, global state, I/O, or unsafe -/// code. +/// It is a logic error for an item to be modified in such a way that the +/// transformation of the item to or from a `usize`, as determined by the +/// `CLike` trait, changes while the item is in the set. This is normally only +/// possible through `Cell`, `RefCell`, global state, I/O, or unsafe code. +#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct EnumSet { // We must maintain the invariant that no bits are set // for which no variant exists @@ -93,22 +98,16 @@ fn bit(e: &E) -> usize { impl EnumSet { /// Returns an empty `EnumSet`. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn new() -> EnumSet { EnumSet {bits: 0, marker: marker::PhantomData} } /// Returns the number of elements in the given `EnumSet`. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn len(&self) -> usize { self.bits.count_ones() as usize } /// Returns true if the `EnumSet` is empty. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn is_empty(&self) -> bool { self.bits == 0 } @@ -118,22 +117,16 @@ impl EnumSet { } /// Returns `false` if the `EnumSet` contains any enum of the given `EnumSet`. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn is_disjoint(&self, other: &EnumSet) -> bool { (self.bits & other.bits) == 0 } /// Returns `true` if a given `EnumSet` is included in this `EnumSet`. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn is_superset(&self, other: &EnumSet) -> bool { (self.bits & other.bits) == other.bits } /// Returns `true` if this `EnumSet` is included in the given `EnumSet`. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn is_subset(&self, other: &EnumSet) -> bool { other.is_superset(self) } @@ -151,8 +144,6 @@ impl EnumSet { } /// Adds an enum to the `EnumSet`, and returns `true` if it wasn't there before - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn insert(&mut self, e: E) -> bool { let result = !self.contains(&e); self.bits |= bit(&e); @@ -160,8 +151,6 @@ impl EnumSet { } /// Removes an enum from the EnumSet - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn remove(&mut self, e: &E) -> bool { let result = self.contains(e); self.bits &= !bit(e); @@ -169,15 +158,11 @@ impl EnumSet { } /// Returns `true` if an `EnumSet` contains a given enum. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn contains(&self, e: &E) -> bool { (self.bits & bit(e)) != 0 } /// Returns an iterator over an `EnumSet`. - #[unstable(feature = "collections", - reason = "matches collection reform specification, waiting for dust to settle")] pub fn iter(&self) -> Iter { Iter::new(self.bits) } diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index ecf5bace382..9762381381c 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -10,14 +10,17 @@ //! Collection types. //! -//! See [std::collections](../std/collections) for a detailed discussion of collections in Rust. +//! See [std::collections](../std/collections) for a detailed discussion of +//! collections in Rust. // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364) #![cfg_attr(stage0, feature(custom_attribute))] #![crate_name = "collections"] -#![unstable(feature = "collections")] #![staged_api] #![crate_type = "rlib"] +#![unstable(feature = "collections", + reason = "library is unlikely to be stabilized with the current \ + layout and name, use std::collections instead")] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/", @@ -107,14 +110,12 @@ pub mod vec; pub mod vec_deque; pub mod vec_map; -#[unstable(feature = "collections", - reason = "RFC 509")] +#[unstable(feature = "bitvec", reason = "RFC 509")] pub mod bit_vec { pub use bit::{BitVec, Iter}; } -#[unstable(feature = "collections", - reason = "RFC 509")] +#[unstable(feature = "bitset", reason = "RFC 509")] pub mod bit_set { pub use bit::{BitSet, Union, Intersection, Difference, SymmetricDifference}; pub use bit::SetIter as Iter; @@ -133,6 +134,7 @@ pub mod btree_set { // FIXME(#14344) this shouldn't be necessary #[doc(hidden)] +#[unstable(feature = "issue_14344_fixme")] pub fn fixme_14344_be_sure_to_link_to_collections() {} #[cfg(not(test))] @@ -141,6 +143,7 @@ mod std { } /// An endpoint of a range of keys. +#[unstable(feature = "collections_bound")] #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)] pub enum Bound { /// An inclusive bound. diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 8ff49efe9d7..a732ce9e81d 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -801,7 +801,7 @@ impl<'a, A> IterMut<'a, A> { /// } /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "linked_list_extras", reason = "this is probably better handled by a cursor type -- we'll see")] pub fn insert_next(&mut self, elt: A) { self.insert_next_node(box Node::new(elt)) @@ -824,7 +824,7 @@ impl<'a, A> IterMut<'a, A> { /// assert_eq!(it.next().unwrap(), &2); /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "linked_list_extras", reason = "this is probably better handled by a cursor type -- we'll see")] pub fn peek_next(&mut self) -> Option<&mut A> { if self.nelem == 0 { diff --git a/src/libcollections/range.rs b/src/libcollections/range.rs index 6ab143998d2..f37c4aede6a 100644 --- a/src/libcollections/range.rs +++ b/src/libcollections/range.rs @@ -7,6 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. + #![unstable(feature = "collections_range", reason = "was just added")] //! Range syntax. diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 310652727b7..c5418c9a0db 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -11,7 +11,8 @@ //! Utilities for slice manipulation //! //! The `slice` module contains useful code to help work with slice values. -//! Slices are a view into a block of memory represented as a pointer and a length. +//! Slices are a view into a block of memory represented as a pointer and a +//! length. //! //! ``` //! // slicing a Vec @@ -69,8 +70,9 @@ //! } //! ``` //! -//! This iterator yields mutable references to the slice's elements, so while the element -//! type of the slice is `i32`, the element type of the iterator is `&mut i32`. +//! This iterator yields mutable references to the slice's elements, so while +//! the element type of the slice is `i32`, the element type of the iterator is +//! `&mut i32`. //! //! * `.iter()` and `.iter_mut()` are the explicit methods to return the default //! iterators. @@ -278,14 +280,14 @@ impl [T] { } /// Returns all but the first element of a slice. - #[unstable(feature = "collections", reason = "likely to be renamed")] + #[unstable(feature = "slice_extras", reason = "likely to be renamed")] #[inline] pub fn tail(&self) -> &[T] { core_slice::SliceExt::tail(self) } /// Returns all but the first element of a mutable slice - #[unstable(feature = "collections", + #[unstable(feature = "slice_extras", reason = "likely to be renamed or removed")] #[inline] pub fn tail_mut(&mut self) -> &mut [T] { @@ -293,14 +295,14 @@ impl [T] { } /// Returns all but the last element of a slice. - #[unstable(feature = "collections", reason = "likely to be renamed")] + #[unstable(feature = "slice_extras", reason = "likely to be renamed")] #[inline] pub fn init(&self) -> &[T] { core_slice::SliceExt::init(self) } /// Returns all but the last element of a mutable slice - #[unstable(feature = "collections", + #[unstable(feature = "slice_extras", reason = "likely to be renamed or removed")] #[inline] pub fn init_mut(&mut self) -> &mut [T] { @@ -727,13 +729,13 @@ impl [T] { } /// Find the first index containing a matching value. - #[unstable(feature = "collections")] + #[unstable(feature = "slice_position_elem")] pub fn position_elem(&self, t: &T) -> Option where T: PartialEq { core_slice::SliceExt::position_elem(self, t) } /// Find the last index containing a matching value. - #[unstable(feature = "collections")] + #[unstable(feature = "slice_position_elem")] pub fn rposition_elem(&self, t: &T) -> Option where T: PartialEq { core_slice::SliceExt::rposition_elem(self, t) } @@ -869,7 +871,7 @@ impl [T] { /// assert_eq!(Some(vec![1, 3, 2]), perms.next()); /// assert_eq!(Some(vec![3, 1, 2]), perms.next()); /// ``` - #[unstable(feature = "collections")] + #[unstable(feature = "permutations")] #[inline] pub fn permutations(&self) -> Permutations where T: Clone { // NB see hack module in this file @@ -893,7 +895,7 @@ impl [T] { /// let b: &mut [_] = &mut [1, 0, 2]; /// assert!(v == b); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "permutations", reason = "uncertain if this merits inclusion in std")] pub fn next_permutation(&mut self) -> bool where T: Ord { core_slice::SliceExt::next_permutation(self) @@ -916,7 +918,7 @@ impl [T] { /// let b: &mut [_] = &mut [0, 1, 2]; /// assert!(v == b); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "permutations", reason = "uncertain if this merits inclusion in std")] pub fn prev_permutation(&mut self) -> bool where T: Ord { core_slice::SliceExt::prev_permutation(self) @@ -940,7 +942,7 @@ impl [T] { /// assert!(dst.clone_from_slice(&src2) == 3); /// assert!(dst == [3, 4, 5]); /// ``` - #[unstable(feature = "collections")] + #[unstable(feature = "clone_from_slice")] pub fn clone_from_slice(&mut self, src: &[T]) -> usize where T: Clone { core_slice::SliceExt::clone_from_slice(self, src) } @@ -967,7 +969,7 @@ impl [T] { /// assert_eq!(num_moved, 3); /// assert!(a == [6, 7, 8, 4, 5]); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "move_from", reason = "uncertain about this API approach")] #[inline] pub fn move_from(&mut self, mut src: Vec, start: usize, end: usize) -> usize { @@ -997,10 +999,12 @@ impl [T] { //////////////////////////////////////////////////////////////////////////////// // Extension traits for slices over specific kinds of data //////////////////////////////////////////////////////////////////////////////// -#[unstable(feature = "collections", reason = "recently changed")] +#[unstable(feature = "slice_concat_ext", + reason = "trait should not have to exist")] /// An extension trait for concatenating slices pub trait SliceConcatExt { - #[unstable(feature = "collections", reason = "recently changed")] + #[unstable(feature = "slice_concat_ext", + reason = "trait should not have to exist")] /// The resulting type after concatenation type Output; @@ -1014,8 +1018,8 @@ pub trait SliceConcatExt { #[stable(feature = "rust1", since = "1.0.0")] fn concat(&self) -> Self::Output; - /// Flattens a slice of `T` into a single value `Self::Output`, placing a given separator - /// between each. + /// Flattens a slice of `T` into a single value `Self::Output`, placing a + /// given separator between each. /// /// # Examples /// @@ -1060,7 +1064,7 @@ impl> SliceConcatExt for [V] { /// /// The last generated swap is always (0, 1), and it returns the /// sequence to its initial order. -#[unstable(feature = "collections")] +#[unstable(feature = "permutations")] #[derive(Clone)] pub struct ElementSwaps { sdir: Vec, @@ -1072,7 +1076,7 @@ pub struct ElementSwaps { impl ElementSwaps { /// Creates an `ElementSwaps` iterator for a sequence of `length` elements. - #[unstable(feature = "collections")] + #[unstable(feature = "permutations")] pub fn new(length: usize) -> ElementSwaps { // Initialize `sdir` with a direction that position should move in // (all negative at the beginning) and the `size` of the @@ -1194,13 +1198,13 @@ impl Iterator for ElementSwaps { /// swap applied. /// /// Generates even and odd permutations alternately. -#[unstable(feature = "collections")] +#[unstable(feature = "permutations")] pub struct Permutations { swaps: ElementSwaps, v: Vec, } -#[unstable(feature = "collections", reason = "trait is unstable")] +#[unstable(feature = "permutations", reason = "trait is unstable")] impl Iterator for Permutations { type Item = Vec; diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 39e1812512f..61e09a2670a 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -366,7 +366,7 @@ impl<'a> Iterator for Recompositions<'a> { /// /// For use with the `std::iter` module. #[derive(Clone)] -#[unstable(feature = "collections")] +#[unstable(feature = "str_utf16")] pub struct Utf16Units<'a> { encoder: Utf16Encoder> } @@ -591,7 +591,7 @@ impl str { /// assert_eq!(s.slice_chars(0, 4), "Löwe"); /// assert_eq!(s.slice_chars(5, 7), "老虎"); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "slice_chars", reason = "may have yet to prove its worth")] pub fn slice_chars(&self, begin: usize, end: usize) -> &str { core_str::StrExt::slice_chars(self, begin, end) @@ -1068,7 +1068,7 @@ impl str { } /// Returns an iterator of `u16` over the string encoded as UTF-16. - #[unstable(feature = "collections", + #[unstable(feature = "str_utf16", reason = "this functionality may only be provided by libunicode")] pub fn utf16_units(&self) -> Utf16Units { Utf16Units { encoder: Utf16Encoder::new(self[..].chars()) } @@ -1527,7 +1527,7 @@ impl str { /// let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect(); /// assert_eq!(v, ["1", "2", "3"]); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "str_matches", reason = "method got recently added")] pub fn matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> Matches<'a, P> { core_str::StrExt::matches(self, pat) @@ -1560,7 +1560,7 @@ impl str { /// let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect(); /// assert_eq!(v, ["3", "2", "1"]); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "str_matches", reason = "method got recently added")] pub fn rmatches<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatches<'a, P> where P::Searcher: ReverseSearcher<'a> @@ -1605,7 +1605,7 @@ impl str { /// let v: Vec<(usize, usize)> = "ababa".match_indices("aba").collect(); /// assert_eq!(v, [(0, 3)]); // only the first `aba` /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "str_matches", reason = "might have its iterator type changed")] // NB: Right now MatchIndices yields `(usize, usize)`, but it would // be more consistent with `matches` and `char_indices` to return `(usize, &str)` @@ -1649,7 +1649,7 @@ impl str { /// let v: Vec<(usize, usize)> = "ababa".rmatch_indices("aba").collect(); /// assert_eq!(v, [(2, 5)]); // only the last `aba` /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "str_matches", reason = "might have its iterator type changed")] // NB: Right now RMatchIndices yields `(usize, usize)`, but it would // be more consistent with `rmatches` and `char_indices` to return `(usize, &str)` @@ -1677,7 +1677,7 @@ impl str { /// assert!(string.subslice_offset(lines[1]) == 2); // &"b" /// assert!(string.subslice_offset(lines[2]) == 4); // &"c" /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "subslice_offset", reason = "awaiting convention about comparability of arbitrary slices")] pub fn subslice_offset(&self, inner: &str) -> usize { core_str::StrExt::subslice_offset(self, inner) @@ -1922,14 +1922,14 @@ impl str { } /// Escapes each char in `s` with `char::escape_default`. - #[unstable(feature = "collections", + #[unstable(feature = "str_escape", reason = "return type may change to be an iterator")] 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 = "collections", + #[unstable(feature = "str_escape", reason = "return type may change to be an iterator")] pub fn escape_unicode(&self) -> String { self.chars().flat_map(|c| c.escape_unicode()).collect() diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 6717f2f45fa..6e37a5731b3 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -696,7 +696,7 @@ impl String { /// # Examples /// /// ``` - /// # #![feature(collections_drain)] + /// # #![feature(drain)] /// /// let mut s = String::from("α is alpha, β is beta"); /// let beta_offset = s.find('β').unwrap_or(s.len()); @@ -710,7 +710,7 @@ impl String { /// s.drain(..); /// assert_eq!(s, ""); /// ``` - #[unstable(feature = "collections_drain", + #[unstable(feature = "drain", reason = "recently added, matches RFC")] pub fn drain(&mut self, range: R) -> Drain where R: RangeArgument { // Memory safety @@ -975,10 +975,14 @@ impl ops::Deref for String { /// Wrapper type providing a `&String` reference via `Deref`. #[unstable(feature = "collections")] +#[deprecated(since = "1.2.0", + reason = "replaced with deref coercions or Borrow")] +#[allow(deprecated)] pub struct DerefString<'a> { x: DerefVec<'a, u8> } +#[allow(deprecated)] impl<'a> Deref for DerefString<'a> { type Target = String; @@ -1005,6 +1009,9 @@ impl<'a> Deref for DerefString<'a> { /// string_consumer(&as_string("foo")); /// ``` #[unstable(feature = "collections")] +#[deprecated(since = "1.2.0", + reason = "replaced with deref coercions or Borrow")] +#[allow(deprecated)] pub fn as_string<'a>(x: &'a str) -> DerefString<'a> { DerefString { x: as_vec(x.as_bytes()) } } @@ -1134,7 +1141,7 @@ impl fmt::Write for String { } /// A draining iterator for `String`. -#[unstable(feature = "collections_drain", reason = "recently added")] +#[unstable(feature = "drain", reason = "recently added")] pub struct Drain<'a> { /// Will be used as &'a mut String in the destructor string: *mut String, @@ -1149,7 +1156,7 @@ pub struct Drain<'a> { unsafe impl<'a> Sync for Drain<'a> {} unsafe impl<'a> Send for Drain<'a> {} -#[unstable(feature = "collections_drain", reason = "recently added")] +#[unstable(feature = "drain", reason = "recently added")] impl<'a> Drop for Drain<'a> { fn drop(&mut self) { unsafe { @@ -1163,7 +1170,7 @@ impl<'a> Drop for Drain<'a> { } } -#[unstable(feature = "collections_drain", reason = "recently added")] +#[unstable(feature = "drain", reason = "recently added")] impl<'a> Iterator for Drain<'a> { type Item = char; @@ -1177,7 +1184,7 @@ impl<'a> Iterator for Drain<'a> { } } -#[unstable(feature = "collections_drain", reason = "recently added")] +#[unstable(feature = "drain", reason = "recently added")] impl<'a> DoubleEndedIterator for Drain<'a> { #[inline] fn next_back(&mut self) -> Option { diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index ba41f438b37..1409ececfc7 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -276,7 +276,7 @@ impl Vec { /// the buffer are copied into the vector without cloning, as if /// `ptr::read()` were called on them. #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "vec_from_raw_buf", reason = "may be better expressed via composition")] pub unsafe fn from_raw_buf(ptr: *const T, elts: usize) -> Vec { let mut dst = Vec::with_capacity(elts); @@ -704,7 +704,7 @@ impl Vec { /// assert_eq!(vec2, []); /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "append", reason = "new API, waiting for dust to settle")] pub fn append(&mut self, other: &mut Self) { if mem::size_of::() == 0 { @@ -742,7 +742,7 @@ impl Vec { /// # Examples /// /// ``` - /// # #![feature(collections_drain)] + /// # #![feature(drain)] /// /// // Draining using `..` clears the whole vector. /// let mut v = vec![1, 2, 3]; @@ -750,7 +750,7 @@ impl Vec { /// assert_eq!(v, &[]); /// assert_eq!(u, &[1, 2, 3]); /// ``` - #[unstable(feature = "collections_drain", + #[unstable(feature = "drain", reason = "recently added, matches RFC")] pub fn drain(&mut self, range: R) -> Drain where R: RangeArgument { // Memory safety @@ -851,7 +851,7 @@ impl Vec { /// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x)); /// assert_eq!(&newtyped_bytes[..], &[Newtype(0x11), Newtype(0x22)]); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "map_in_place", reason = "API may change to provide stronger guarantees")] pub fn map_in_place(self, mut f: F) -> Vec where F: FnMut(T) -> U { // FIXME: Assert statically that the types `T` and `U` have the same @@ -1043,14 +1043,14 @@ impl Vec { /// # Examples /// /// ``` - /// # #![feature(collections)] + /// # #![feature(split_off)] /// let mut vec = vec![1,2,3]; /// let vec2 = vec.split_off(1); /// assert_eq!(vec, [1]); /// assert_eq!(vec2, [2, 3]); /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "split_off", reason = "new API, waiting for dust to settle")] pub fn split_off(&mut self, at: usize) -> Self { assert!(at <= self.len(), "`at` out of bounds"); @@ -1091,7 +1091,7 @@ impl Vec { /// vec.resize(2, 0); /// assert_eq!(vec, [1, 2]); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "vec_resize", reason = "matches collection reform specification; waiting for dust to settle")] pub fn resize(&mut self, new_len: usize, value: T) { let len = self.len(); @@ -1117,7 +1117,7 @@ impl Vec { /// assert_eq!(vec, [1, 2, 3, 4]); /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "vec_push_all", reason = "likely to be replaced by a more optimized extend")] pub fn push_all(&mut self, other: &[T]) { self.reserve(other.len()); @@ -1738,7 +1738,7 @@ unsafe impl Sync for IntoIter { } impl IntoIter { #[inline] /// Drops all items that have not yet been moved and returns the empty vector. - #[unstable(feature = "collections")] + #[unstable(feature = "iter_to_vec")] pub fn into_inner(mut self) -> Vec { unsafe { for _x in self.by_ref() { } @@ -1832,7 +1832,7 @@ impl Drop for IntoIter { } /// A draining iterator for `Vec`. -#[unstable(feature = "collections_drain", reason = "recently added")] +#[unstable(feature = "drain", reason = "recently added")] pub struct Drain<'a, T: 'a> { /// Index of tail to preserve tail_start: usize, @@ -1907,12 +1907,17 @@ impl<'a, T> ExactSizeIterator for Drain<'a, T> {} /// Wrapper type providing a `&Vec` reference via `Deref`. #[unstable(feature = "collections")] +#[deprecated(since = "1.2.0", + reason = "replaced with deref coercions or Borrow")] pub struct DerefVec<'a, T:'a> { x: Vec, l: PhantomData<&'a T>, } #[unstable(feature = "collections")] +#[deprecated(since = "1.2.0", + reason = "replaced with deref coercions or Borrow")] +#[allow(deprecated)] impl<'a, T> Deref for DerefVec<'a, T> { type Target = Vec; @@ -1923,6 +1928,9 @@ impl<'a, T> Deref for DerefVec<'a, T> { // Prevent the inner `Vec` from attempting to deallocate memory. #[stable(feature = "rust1", since = "1.0.0")] +#[deprecated(since = "1.2.0", + reason = "replaced with deref coercions or Borrow")] +#[allow(deprecated)] impl<'a, T> Drop for DerefVec<'a, T> { fn drop(&mut self) { self.x.len = 0; @@ -1948,6 +1956,9 @@ impl<'a, T> Drop for DerefVec<'a, T> { /// vec_consumer(&as_vec(&values)); /// ``` #[unstable(feature = "collections")] +#[deprecated(since = "1.2.0", + reason = "replaced with deref coercions or Borrow")] +#[allow(deprecated)] pub fn as_vec<'a, T>(x: &'a [T]) -> DerefVec<'a, T> { unsafe { DerefVec { diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index da13684b4f3..54127ea8a9e 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -491,7 +491,7 @@ impl VecDeque { /// assert_eq!(buf.len(), 1); /// assert_eq!(Some(&5), buf.get(0)); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "deque_extras", reason = "matches collection reform specification; waiting on panic semantics")] pub fn truncate(&mut self, len: usize) { for _ in len..self.len() { @@ -552,7 +552,7 @@ impl VecDeque { /// Returns a pair of slices which contain, in order, the contents of the /// `VecDeque`. #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "deque_extras", reason = "matches collection reform specification, waiting for dust to settle")] pub fn as_slices(&self) -> (&[T], &[T]) { unsafe { @@ -572,7 +572,7 @@ impl VecDeque { /// Returns a pair of slices which contain, in order, the contents of the /// `VecDeque`. #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "deque_extras", reason = "matches collection reform specification, waiting for dust to settle")] pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T]) { unsafe { @@ -638,7 +638,7 @@ impl VecDeque { /// assert!(v.is_empty()); /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "drain", reason = "matches collection reform specification, waiting for dust to settle")] pub fn drain(&mut self) -> Drain { Drain { @@ -880,7 +880,7 @@ impl VecDeque { /// buf.push_back(10); /// assert_eq!(buf.swap_back_remove(1), Some(99)); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "deque_extras", reason = "the naming of this function may be altered")] pub fn swap_back_remove(&mut self, index: usize) -> Option { let length = self.len(); @@ -914,7 +914,7 @@ impl VecDeque { /// buf.push_back(20); /// assert_eq!(buf.swap_front_remove(3), Some(99)); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "deque_extras", reason = "the naming of this function may be altered")] pub fn swap_front_remove(&mut self, index: usize) -> Option { let length = self.len(); @@ -1320,7 +1320,7 @@ impl VecDeque { /// assert_eq!(buf2.len(), 2); /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "split_off", reason = "new API, waiting for dust to settle")] pub fn split_off(&mut self, at: usize) -> Self { let len = self.len(); @@ -1383,7 +1383,7 @@ impl VecDeque { /// assert_eq!(buf2.len(), 0); /// ``` #[inline] - #[unstable(feature = "collections", + #[unstable(feature = "append", reason = "new API, waiting for dust to settle")] pub fn append(&mut self, other: &mut Self) { // naive impl @@ -1447,7 +1447,7 @@ impl VecDeque { /// assert_eq!(a, b); /// } /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "deque_extras", reason = "matches collection reform specification; waiting on panic semantics")] pub fn resize(&mut self, new_len: usize, value: T) { let len = self.len(); @@ -1635,7 +1635,7 @@ impl DoubleEndedIterator for IntoIter { impl ExactSizeIterator for IntoIter {} /// A draining VecDeque iterator -#[unstable(feature = "collections", +#[unstable(feature = "drain", reason = "matches collection reform specification, waiting for dust to settle")] pub struct Drain<'a, T: 'a> { inner: &'a mut VecDeque, diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs index 5c2f5759604..3fd2455a004 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -12,6 +12,8 @@ //! are O(highest integer key). #![allow(missing_docs)] +#![unstable(feature = "vecmap", + reason = "may not be stabilized in the standard library")] use self::Entry::*; @@ -325,7 +327,7 @@ impl VecMap { /// assert_eq!(a[3], "c"); /// assert_eq!(a[4], "d"); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "append", reason = "recently added as part of collections reform 2")] pub fn append(&mut self, other: &mut Self) { self.extend(other.drain()); @@ -358,7 +360,7 @@ impl VecMap { /// assert_eq!(b[3], "c"); /// assert_eq!(b[4], "d"); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "split_off", reason = "recently added as part of collections reform 2")] pub fn split_off(&mut self, at: usize) -> Self { let mut other = VecMap::new(); @@ -410,7 +412,7 @@ impl VecMap { /// /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "drain", reason = "matches collection reform specification, waiting for dust to settle")] pub fn drain<'a>(&'a mut self) -> Drain<'a, V> { fn filter((i, v): (usize, Option)) -> Option<(usize, A)> { @@ -632,7 +634,7 @@ impl VecMap { impl<'a, V> Entry<'a, V> { - #[unstable(feature = "collections", + #[unstable(feature = "entry", reason = "will soon be replaced by or_insert")] #[deprecated(since = "1.0", reason = "replaced with more ergonomic `or_insert` and `or_insert_with`")] @@ -644,7 +646,7 @@ impl<'a, V> Entry<'a, V> { } } - #[unstable(feature = "collections", + #[unstable(feature = "entry", reason = "matches entry v3 specification, waiting for dust to settle")] /// Ensures a value is in the entry by inserting the default if empty, and returns /// a mutable reference to the value in the entry. @@ -655,7 +657,7 @@ impl<'a, V> Entry<'a, V> { } } - #[unstable(feature = "collections", + #[unstable(feature = "entry", reason = "matches entry v3 specification, waiting for dust to settle")] /// Ensures a value is in the entry by inserting the result of the default function if empty, /// and returns a mutable reference to the value in the entry. @@ -1003,14 +1005,14 @@ pub struct IntoIter { fn((usize, Option)) -> Option<(usize, V)>> } -#[unstable(feature = "collections")] +#[unstable(feature = "drain")] pub struct Drain<'a, V:'a> { iter: FilterMap< Enumerate>>, fn((usize, Option)) -> Option<(usize, V)>> } -#[unstable(feature = "collections")] +#[unstable(feature = "drain")] impl<'a, V> Iterator for Drain<'a, V> { type Item = (usize, V); @@ -1018,7 +1020,7 @@ impl<'a, V> Iterator for Drain<'a, V> { fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } -#[unstable(feature = "collections")] +#[unstable(feature = "drain")] impl<'a, V> DoubleEndedIterator for Drain<'a, V> { fn next_back(&mut self) -> Option<(usize, V)> { self.iter.next_back() } } diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index f6c5d66f55c..f8d80035d97 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -281,8 +281,9 @@ #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] -#![feature(collections)] + #![feature(into_cow)] +#![feature(str_escape)] use self::LabelText::*; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 944af19a443..49667bf74cf 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -25,18 +25,22 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] +#![feature(append)] #![feature(associated_consts)] #![feature(box_patterns)] #![feature(box_syntax)] +#![feature(clone_from_slice)] #![feature(collections)] #![feature(const_fn)] #![feature(duration)] #![feature(duration_span)] +#![feature(enumset)] #![feature(fs_canonicalize)] #![feature(hash_default)] #![feature(into_cow)] #![feature(iter_sum)] #![feature(libc)] +#![feature(map_in_place)] #![feature(num_bits_bytes)] #![feature(path_ext)] #![feature(quote)] @@ -45,10 +49,14 @@ #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(slice_bytes)] +#![feature(slice_extras)] #![feature(slice_patterns)] +#![feature(slice_position_elem)] #![feature(staged_api)] #![feature(std_misc)] #![feature(str_char)] +#![feature(str_matches)] +#![feature(vec_push_all)] #![feature(wrapping)] #![cfg_attr(test, feature(test))] diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index e4d0c9aa15f..297041a9907 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -33,7 +33,6 @@ html_root_url = "http://doc.rust-lang.org/nightly/")] #![feature(box_syntax)] -#![feature(collections)] #![feature(fs_canonicalize)] #![feature(libc)] #![feature(path_ext)] @@ -42,6 +41,7 @@ #![feature(slice_bytes)] #![feature(staged_api)] #![feature(step_by)] +#![feature(vec_push_all)] #![cfg_attr(test, feature(test, rand))] extern crate syntax; diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 6ae0ea81c3d..e369ca46b2c 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -26,14 +26,15 @@ html_root_url = "http://doc.rust-lang.org/nightly/")] #![feature(box_syntax)] -#![feature(collections)] +#![feature(exit_status)] #![feature(libc)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] -#![feature(staged_api)] -#![feature(exit_status)] #![feature(set_stdio)] +#![feature(staged_api)] +#![feature(str_casing)] +#![feature(vec_push_all)] extern crate arena; extern crate flate; diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 88d30761020..d53689bb1d1 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -30,17 +30,17 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] +#![cfg_attr(test, feature(test))] #![feature(box_patterns)] #![feature(box_syntax)] -#![feature(collections)] #![feature(num_bits_bytes)] #![feature(quote)] #![feature(ref_slice)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] +#![feature(str_casing)] #![feature(str_char)] -#![cfg_attr(test, feature(test))] extern crate syntax; #[macro_use] diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index bf331705b32..bea934c6aa0 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -27,10 +27,10 @@ #![feature(associated_consts)] #![feature(box_syntax)] -#![feature(collections)] #![feature(libc)] #![feature(link_args)] #![feature(staged_api)] +#![feature(vec_push_all)] extern crate libc; #[macro_use] #[no_link] extern crate rustc_bitflags; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 0c0fd3f93dc..787f914718d 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -20,10 +20,10 @@ html_root_url = "http://doc.rust-lang.org/nightly/")] #![feature(associated_consts)] -#![feature(collections)] #![feature(rc_weak)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] +#![feature(slice_extras)] #![feature(staged_api)] #[macro_use] extern crate log; diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index d0fadd6565c..5ace7728495 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -27,7 +27,6 @@ #![feature(box_patterns)] #![feature(box_syntax)] -#![feature(collections)] #![feature(const_fn)] #![feature(fs)] #![feature(iter_cmp)] @@ -46,6 +45,7 @@ #![feature(std_misc)] #![feature(unicode)] #![feature(unicode)] +#![feature(vec_push_all)] #![allow(trivial_casts)] diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index f5a7ec4dbd2..f204fa2b1fd 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -77,14 +77,16 @@ This API is completely unstable and subject to change. #![feature(box_patterns)] #![feature(box_syntax)] -#![feature(collections, collections_drain)] +#![feature(drain)] #![feature(iter_cmp)] #![feature(iter_sum)] #![feature(quote)] #![feature(ref_slice)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] +#![feature(slice_extras)] #![feature(staged_api)] +#![feature(vec_push_all)] #[macro_use] extern crate log; #[macro_use] extern crate syntax; diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs index a7ced76e10c..0ad5141c5be 100644 --- a/src/librustc_unicode/char.rs +++ b/src/librustc_unicode/char.rs @@ -310,7 +310,9 @@ impl char { #[unstable(feature = "unicode", reason = "pending decision about Iterator/Writer/Reader")] #[inline] - pub fn encode_utf8(self, dst: &mut [u8]) -> Option { C::encode_utf8(self, dst) } + pub fn encode_utf8(self, dst: &mut [u8]) -> Option { + C::encode_utf8(self, dst) + } /// Encodes this character as UTF-16 into the provided `u16` buffer, and /// then returns the number of `u16`s written. @@ -345,7 +347,9 @@ impl char { #[unstable(feature = "unicode", reason = "pending decision about Iterator/Writer/Reader")] #[inline] - pub fn encode_utf16(self, dst: &mut [u16]) -> Option { C::encode_utf16(self, dst) } + pub fn encode_utf16(self, dst: &mut [u16]) -> Option { + C::encode_utf16(self, dst) + } /// Returns whether the specified character is considered a Unicode /// alphabetic code point. @@ -541,5 +545,7 @@ impl char { #[unstable(feature = "unicode", reason = "needs expert opinion. is_cjk flag stands out as ugly")] #[inline] - pub fn width(self, is_cjk: bool) -> Option { charwidth::width(self, is_cjk) } + pub fn width(self, is_cjk: bool) -> Option { + charwidth::width(self, is_cjk) + } } diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 8170dd95730..7fdab878915 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -36,6 +36,8 @@ Core encoding and decoding interfaces. #![feature(std_misc)] #![feature(str_char)] #![feature(unicode)] +#![feature(vecmap)] +#![feature(enumset)] #![cfg_attr(test, feature(test))] // test harness access diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 75044881223..20211f87689 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -110,7 +110,9 @@ #![feature(box_raw)] #![feature(box_syntax)] #![feature(char_internals)] +#![feature(clone_from_slice)] #![feature(collections)] +#![feature(collections_bound)] #![feature(const_fn)] #![feature(core)] #![feature(core_float)] @@ -126,6 +128,8 @@ #![feature(libc)] #![feature(linkage, thread_local, asm)] #![feature(macro_reexport)] +#![feature(slice_concat_ext)] +#![feature(slice_position_elem)] #![feature(no_std)] #![feature(num_bits_bytes)] #![feature(oom)] @@ -142,6 +146,7 @@ #![feature(unicode)] #![feature(unique)] #![feature(unsafe_no_drop_flag, filling_drop)] +#![feature(vec_push_all)] #![feature(wrapping)] #![feature(zero_one)] #![cfg_attr(test, feature(float_from_str_radix))] diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 432cdbdfef0..7333265bdd4 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -26,15 +26,17 @@ html_root_url = "http://doc.rust-lang.org/nightly/")] #![feature(associated_consts)] -#![feature(collections)] -#![feature(collections_drain)] +#![feature(bitset)] +#![feature(drain)] #![feature(filling_drop)] #![feature(libc)] #![feature(ref_slice)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(str_char)] +#![feature(str_escape)] #![feature(unicode)] +#![feature(vec_push_all)] extern crate fmt_macros; extern crate serialize; diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index ec1426e6e48..3affb37ba5b 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -56,12 +56,12 @@ #![deny(missing_docs)] #![feature(box_syntax)] -#![feature(collections)] +#![feature(path_ext)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(std_misc)] #![feature(str_char)] -#![feature(path_ext)] +#![feature(vec_push_all)] #![cfg_attr(windows, feature(libc))] #[macro_use] extern crate log; diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 6ee6f8c2e24..46649689134 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -36,7 +36,6 @@ #![feature(asm)] #![feature(box_syntax)] -#![feature(collections)] #![feature(duration)] #![feature(duration_span)] #![feature(fnbox)] @@ -44,6 +43,7 @@ #![feature(libc)] #![feature(rustc_private)] #![feature(set_stdio)] +#![feature(slice_extras)] #![feature(staged_api)] #![feature(std_misc)] diff --git a/src/rustbook/main.rs b/src/rustbook/main.rs index 09fcd518c1e..e79462a4aaf 100644 --- a/src/rustbook/main.rs +++ b/src/rustbook/main.rs @@ -10,11 +10,11 @@ #![deny(warnings)] -#![feature(core)] #![feature(exit_status)] -#![feature(rustdoc)] -#![feature(rustc_private)] +#![feature(iter_sum)] #![feature(path_relative_from)] +#![feature(rustc_private)] +#![feature(rustdoc)] extern crate rustdoc; extern crate rustc_back;