Fallout in tests and docs from feature renamings

This commit is contained in:
Alex Crichton 2015-06-10 13:33:52 -07:00
parent 6895311e85
commit ce1a965cf5
118 changed files with 367 additions and 341 deletions

View File

@ -11,13 +11,14 @@
#![crate_type = "bin"]
#![feature(box_syntax)]
#![feature(collections)]
#![feature(rustc_private)]
#![feature(std_misc)]
#![feature(test)]
#![feature(path_ext)]
#![feature(str_char)]
#![feature(dynamic_lib)]
#![feature(libc)]
#![feature(path_ext)]
#![feature(rustc_private)]
#![feature(slice_extras)]
#![feature(str_char)]
#![feature(test)]
#![feature(vec_push_all)]
#![deny(warnings)]

View File

@ -191,7 +191,7 @@ impl<T: ?Sized> Arc<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(arc_weak)]
/// use std::sync::Arc;
///
/// let five = Arc::new(5);
@ -236,12 +236,12 @@ impl<T: ?Sized> Arc<T> {
/// Get the number of weak references to this value.
#[inline]
#[unstable(feature = "arc_extras")]
#[unstable(feature = "arc_counts")]
pub fn weak_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().weak.load(SeqCst) - 1 }
/// Get the number of strong references to this value.
#[inline]
#[unstable(feature = "arc_extras")]
#[unstable(feature = "arc_counts")]
pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst) }
@ -255,7 +255,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(arc_unique, alloc)]
/// extern crate alloc;
/// # fn main() {
/// use alloc::arc::{Arc, get_mut};
@ -271,7 +271,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa
/// # }
/// ```
#[inline]
#[unstable(feature = "arc_extras")]
#[unstable(feature = "arc_unique")]
pub unsafe fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> {
// FIXME(#24880) potential race with upgraded weak pointers here
if strong_count(this) == 1 && weak_count(this) == 0 {
@ -342,7 +342,7 @@ impl<T: Clone> Arc<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(arc_unique)]
/// use std::sync::Arc;
///
/// # unsafe {
@ -352,7 +352,7 @@ impl<T: Clone> Arc<T> {
/// # }
/// ```
#[inline]
#[unstable(feature = "arc_extras")]
#[unstable(feature = "arc_unique")]
pub unsafe fn make_unique(&mut self) -> &mut T {
// FIXME(#24880) potential race with upgraded weak pointers here
//
@ -451,7 +451,7 @@ impl<T: ?Sized> Weak<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(arc_weak)]
/// use std::sync::Arc;
///
/// let five = Arc::new(5);
@ -489,7 +489,7 @@ impl<T: ?Sized> Clone for Weak<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(arc_weak)]
/// use std::sync::Arc;
///
/// let weak_five = Arc::new(5).downgrade();
@ -513,7 +513,7 @@ impl<T: ?Sized> Drop for Weak<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(arc_weak)]
/// use std::sync::Arc;
///
/// {

View File

@ -71,7 +71,7 @@ use core::raw::{TraitObject};
/// The following two examples are equivalent:
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(box_heap)]
/// #![feature(box_syntax)]
/// use std::boxed::HEAP;
///
@ -139,7 +139,7 @@ impl<T : ?Sized> Box<T> {
///
/// # Examples
/// ```
/// # #![feature(alloc)]
/// # #![feature(box_raw)]
/// use std::boxed;
///
/// let seventeen = Box::new(17u32);
@ -183,7 +183,7 @@ impl<T: Clone> Clone for Box<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc, core)]
/// # #![feature(box_raw)]
/// let x = Box::new(5);
/// let mut y = Box::new(10);
///
@ -336,7 +336,7 @@ impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {}
/// -> i32>`.
///
/// ```
/// #![feature(core)]
/// #![feature(fnbox)]
///
/// use std::boxed::FnBox;
/// use std::collections::HashMap;

View File

@ -89,7 +89,7 @@
#![feature(unsafe_no_drop_flag, filling_drop)]
#![feature(unsize)]
#![cfg_attr(test, feature(test, alloc, rustc_private))]
#![cfg_attr(test, feature(test, alloc, rustc_private, box_raw))]
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
feature(libc))]

View File

@ -32,7 +32,6 @@
//! and have the `Owner` remain allocated as long as any `Gadget` points at it.
//!
//! ```rust
//! # #![feature(alloc)]
//! use std::rc::Rc;
//!
//! struct Owner {
@ -92,7 +91,7 @@
//! documentation for more details on interior mutability.
//!
//! ```rust
//! # #![feature(alloc)]
//! # #![feature(rc_weak)]
//! use std::rc::Rc;
//! use std::rc::Weak;
//! use std::cell::RefCell;
@ -229,7 +228,7 @@ impl<T: ?Sized> Rc<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_weak)]
/// use std::rc::Rc;
///
/// let five = Rc::new(5);
@ -246,12 +245,12 @@ impl<T: ?Sized> Rc<T> {
/// Get the number of weak references to this value.
#[inline]
#[unstable(feature = "rc_extras")]
#[unstable(feature = "rc_counts")]
pub fn weak_count<T: ?Sized>(this: &Rc<T>) -> usize { this.weak() - 1 }
/// Get the number of strong references to this value.
#[inline]
#[unstable(feature = "rc_extras")]
#[unstable(feature = "rc_counts")]
pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() }
/// Returns true if there are no other `Rc` or `Weak<T>` values that share the
@ -260,7 +259,7 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() }
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_unique)]
/// use std::rc;
/// use std::rc::Rc;
///
@ -269,7 +268,7 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() }
/// rc::is_unique(&five);
/// ```
#[inline]
#[unstable(feature = "rc_extras")]
#[unstable(feature = "rc_unique")]
pub fn is_unique<T>(rc: &Rc<T>) -> bool {
weak_count(rc) == 0 && strong_count(rc) == 1
}
@ -281,7 +280,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_unique)]
/// use std::rc::{self, Rc};
///
/// let x = Rc::new(3);
@ -292,7 +291,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4)));
/// ```
#[inline]
#[unstable(feature = "rc_extras")]
#[unstable(feature = "rc_unique")]
pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
if is_unique(&rc) {
unsafe {
@ -316,7 +315,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_unique)]
/// use std::rc::{self, Rc};
///
/// let mut x = Rc::new(3);
@ -327,7 +326,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
/// assert!(rc::get_mut(&mut x).is_none());
/// ```
#[inline]
#[unstable(feature = "rc_extras")]
#[unstable(feature = "rc_unique")]
pub fn get_mut<T>(rc: &mut Rc<T>) -> Option<&mut T> {
if is_unique(rc) {
let inner = unsafe { &mut **rc._ptr };
@ -346,7 +345,7 @@ impl<T: Clone> Rc<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_unique)]
/// use std::rc::Rc;
///
/// let mut five = Rc::new(5);
@ -354,7 +353,7 @@ impl<T: Clone> Rc<T> {
/// let mut_five = five.make_unique();
/// ```
#[inline]
#[unstable(feature = "rc_extras")]
#[unstable(feature = "rc_unique")]
pub fn make_unique(&mut self) -> &mut T {
if !is_unique(self) {
*self = Rc::new((**self).clone())
@ -390,7 +389,6 @@ impl<T: ?Sized> Drop for Rc<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// use std::rc::Rc;
///
/// {
@ -443,7 +441,6 @@ impl<T: ?Sized> Clone for Rc<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// use std::rc::Rc;
///
/// let five = Rc::new(5);
@ -677,7 +674,7 @@ impl<T: ?Sized> Weak<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_weak)]
/// use std::rc::Rc;
///
/// let five = Rc::new(5);
@ -705,7 +702,7 @@ impl<T: ?Sized> Drop for Weak<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_weak)]
/// use std::rc::Rc;
///
/// {
@ -752,7 +749,7 @@ impl<T: ?Sized> Clone for Weak<T> {
/// # Examples
///
/// ```
/// # #![feature(alloc)]
/// # #![feature(rc_weak)]
/// use std::rc::Rc;
///
/// let weak_five = Rc::new(5).downgrade();

View File

@ -38,7 +38,7 @@
//! [sieve]: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
//!
//! ```
//! # #![feature(collections, core, step_by)]
//! # #![feature(bitset, bitvec, range_inclusive, step_by)]
//! use std::collections::{BitSet, BitVec};
//! use std::iter;
//!
@ -133,7 +133,7 @@ const FALSE: &'static bool = &false;
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(10, false);
@ -250,7 +250,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
/// let mut bv = BitVec::new();
/// ```
@ -265,7 +265,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let bv = BitVec::from_elem(10, false);
@ -306,7 +306,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let bv = BitVec::from_bytes(&[0b10100000, 0b00010010]);
@ -349,7 +349,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let bv = BitVec::from_fn(5, |i| { i % 2 == 0 });
@ -368,7 +368,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let bv = BitVec::from_bytes(&[0b01100000]);
@ -401,7 +401,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(5, false);
@ -424,7 +424,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let before = 0b01100000;
@ -445,7 +445,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let before = 0b01100000;
@ -474,7 +474,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let a = 0b01100100;
@ -505,7 +505,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let a = 0b01100100;
@ -536,7 +536,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let a = 0b01100100;
@ -566,7 +566,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(5, true);
@ -591,7 +591,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let bv = BitVec::from_bytes(&[0b01110100, 0b10010010]);
@ -712,7 +712,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(10, false);
@ -730,7 +730,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(10, false);
@ -752,7 +752,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(3, true);
@ -800,7 +800,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let bv = BitVec::from_bytes(&[0b10100000]);
@ -821,7 +821,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_bytes(&[0b01001011]);
@ -848,7 +848,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(3, false);
@ -879,7 +879,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(3, false);
@ -902,7 +902,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::new();
@ -924,7 +924,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_bytes(&[0b01001011]);
@ -975,7 +975,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_bytes(&[0b01001001]);
@ -1006,7 +1006,7 @@ impl BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec)]
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::new();
@ -1224,7 +1224,7 @@ impl<'a> IntoIterator for &'a BitVec {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitvec, bitset)]
/// use std::collections::{BitSet, BitVec};
///
/// // It's a regular set
@ -1328,7 +1328,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::new();
@ -1345,7 +1345,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::with_capacity(100);
@ -1363,7 +1363,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitVec, BitSet};
///
/// let bv = BitVec::from_bytes(&[0b01100000]);
@ -1385,7 +1385,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::with_capacity(100);
@ -1397,9 +1397,9 @@ impl BitSet {
self.bit_vec.capacity()
}
/// Reserves capacity for the given `BitSet` to contain `len` distinct elements. In the case
/// of `BitSet` this means reallocations will not occur as long as all inserted elements
/// are less than `len`.
/// Reserves capacity for the given `BitSet` to contain `len` distinct
/// elements. In the case of `BitSet` this means reallocations will not
/// occur as long as all inserted elements are less than `len`.
///
/// The collection may reserve more space to avoid frequent reallocations.
///
@ -1407,7 +1407,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::new();
@ -1422,19 +1422,19 @@ impl BitSet {
}
}
/// Reserves the minimum capacity for the given `BitSet` to contain `len` distinct elements.
/// In the case of `BitSet` this means reallocations will not occur as long as all inserted
/// elements are less than `len`.
/// Reserves the minimum capacity for the given `BitSet` to contain `len`
/// distinct elements. In the case of `BitSet` this means reallocations
/// will not occur as long as all inserted elements are less than `len`.
///
/// Note that the allocator may give the collection more space than it requests. Therefore
/// capacity can not be relied upon to be precisely minimal. Prefer `reserve_len` if future
/// insertions are expected.
/// Note that the allocator may give the collection more space than it
/// requests. Therefore capacity can not be relied upon to be precisely
/// minimal. Prefer `reserve_len` if future insertions are expected.
///
///
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::new();
@ -1455,7 +1455,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::new();
@ -1476,7 +1476,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::new();
@ -1523,7 +1523,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset)]
/// use std::collections::BitSet;
///
/// let mut s = BitSet::new();
@ -1556,7 +1556,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitVec, BitSet};
///
/// let s = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01001010]));
@ -1578,7 +1578,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitVec, BitSet};
///
/// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@ -1602,12 +1602,13 @@ impl BitSet {
}
/// Iterator over each usize stored in `self` intersect `other`.
/// See [intersect_with](#method.intersect_with) for an efficient in-place version.
/// See [intersect_with](#method.intersect_with) for an efficient in-place
/// version.
///
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitVec, BitSet};
///
/// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@ -1632,12 +1633,13 @@ impl BitSet {
}
/// Iterator over each usize stored in the `self` setminus `other`.
/// See [difference_with](#method.difference_with) for an efficient in-place version.
/// See [difference_with](#method.difference_with) for an efficient in-place
/// version.
///
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitSet, BitVec};
///
/// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@ -1667,14 +1669,15 @@ impl BitSet {
}))
}
/// Iterator over each usize stored in the symmetric difference of `self` and `other`.
/// See [symmetric_difference_with](#method.symmetric_difference_with) for
/// an efficient in-place version.
/// Iterator over each usize stored in the symmetric difference of `self`
/// and `other`. See
/// [symmetric_difference_with](#method.symmetric_difference_with) for an
/// efficient in-place version.
///
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitSet, BitVec};
///
/// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@ -1702,7 +1705,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitSet, BitVec};
///
/// let a = 0b01101000;
@ -1726,7 +1729,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitSet, BitVec};
///
/// let a = 0b01101000;
@ -1751,7 +1754,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitSet, BitVec};
///
/// let a = 0b01101000;
@ -1784,7 +1787,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(bitset, bitvec)]
/// use std::collections::{BitSet, BitVec};
///
/// let a = 0b01101000;
@ -1808,7 +1811,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(collections, append)]
/// # #![feature(bitset, bitvec, append)]
/// use std::collections::{BitVec, BitSet};
///
/// let mut a = BitSet::new();
@ -1839,7 +1842,7 @@ impl BitSet {
/// # Examples
///
/// ```
/// # #![feature(bitset, split_off)]
/// # #![feature(bitset, bitvec, split_off)]
/// use std::collections::{BitSet, BitVec};
/// let mut a = BitSet::new();
/// a.insert(2);

View File

@ -1507,7 +1507,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(btree_range, collections_bound)]
/// use std::collections::BTreeMap;
/// use std::collections::Bound::{Included, Unbounded};
///
@ -1534,7 +1534,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(btree_range, collections_bound)]
/// use std::collections::BTreeMap;
/// use std::collections::Bound::{Included, Excluded};
///

View File

@ -141,7 +141,7 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(btree_range, collections_bound)]
/// use std::collections::BTreeSet;
/// use std::collections::Bound::{Included, Unbounded};
///

View File

@ -172,9 +172,8 @@
//! like:
//!
//! ```
//! # #![feature(core, std_misc)]
//! # #![feature(fmt_flags)]
//! use std::fmt;
//! use std::f64;
//!
//! #[derive(Debug)]
//! struct Vector2D {

View File

@ -44,8 +44,8 @@
#![feature(iter_cmp)]
#![feature(iter_idx)]
#![feature(iter_order)]
#![feature(iter_product)]
#![feature(iter_sum)]
#![feature(iter_arith)]
#![feature(iter_arith)]
#![feature(lang_items)]
#![feature(num_bits_bytes)]
#![feature(oom)]

View File

@ -784,7 +784,7 @@ impl<'a, A> IterMut<'a, A> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(linked_list_extras)]
/// use std::collections::LinkedList;
///
/// let mut list: LinkedList<_> = vec![1, 3, 4].into_iter().collect();
@ -812,7 +812,7 @@ impl<'a, A> IterMut<'a, A> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(linked_list_extras)]
/// use std::collections::LinkedList;
///
/// let mut list: LinkedList<_> = vec![1, 2, 3].into_iter().collect();

View File

@ -851,7 +851,7 @@ impl<T> [T] {
/// # Examples
///
/// ```rust
/// # #![feature(collections)]
/// # #![feature(permutations)]
/// let v = [1, 2, 3];
/// let mut perms = v.permutations();
///
@ -863,7 +863,7 @@ impl<T> [T] {
/// Iterating through permutations one by one.
///
/// ```rust
/// # #![feature(collections)]
/// # #![feature(permutations)]
/// let v = [1, 2, 3];
/// let mut perms = v.permutations();
///
@ -886,7 +886,7 @@ impl<T> [T] {
/// # Example
///
/// ```rust
/// # #![feature(collections)]
/// # #![feature(permutations)]
/// let v: &mut [_] = &mut [0, 1, 2];
/// v.next_permutation();
/// let b: &mut [_] = &mut [0, 2, 1];
@ -909,7 +909,7 @@ impl<T> [T] {
/// # Example
///
/// ```rust
/// # #![feature(collections)]
/// # #![feature(permutations)]
/// let v: &mut [_] = &mut [1, 0, 2];
/// v.prev_permutation();
/// let b: &mut [_] = &mut [0, 2, 1];
@ -931,7 +931,7 @@ impl<T> [T] {
/// # Example
///
/// ```rust
/// # #![feature(collections)]
/// # #![feature(clone_from_slice)]
/// let mut dst = [0, 0, 0];
/// let src = [1, 2];
///
@ -962,7 +962,7 @@ impl<T> [T] {
/// # Examples
///
/// ```rust
/// # #![feature(collections)]
/// # #![feature(move_from)]
/// let mut a = [1, 2, 3, 4, 5];
/// let b = vec![6, 7, 8];
/// let num_moved = a.move_from(b, 0, 3);

View File

@ -585,7 +585,7 @@ impl str {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(slice_chars)]
/// let s = "Löwe 老虎 Léopard";
///
/// assert_eq!(s.slice_chars(0, 4), "Löwe");
@ -1520,7 +1520,7 @@ impl str {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(str_matches)]
/// let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
/// assert_eq!(v, ["abc", "abc", "abc"]);
///
@ -1553,7 +1553,7 @@ impl str {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(str_matches)]
/// let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
/// assert_eq!(v, ["abc", "abc", "abc"]);
///
@ -1595,7 +1595,7 @@ impl str {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(str_matches)]
/// let v: Vec<(usize, usize)> = "abcXXXabcYYYabc".match_indices("abc").collect();
/// assert_eq!(v, [(0, 3), (6, 9), (12, 15)]);
///
@ -1639,7 +1639,7 @@ impl str {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(str_matches)]
/// let v: Vec<(usize, usize)> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
/// assert_eq!(v, [(12, 15), (6, 9), (0, 3)]);
///
@ -1669,7 +1669,7 @@ impl str {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(subslice_offset)]
/// let string = "a\nb\nc";
/// let lines: Vec<&str> = string.lines().collect();
///
@ -1863,7 +1863,7 @@ impl str {
/// # Examples
///
/// ```
/// #![feature(collections)]
/// #![feature(str_casing)]
///
/// let s = "HELLO";
/// assert_eq!(s.to_lowercase(), "hello");
@ -1909,7 +1909,7 @@ impl str {
/// # Examples
///
/// ```
/// #![feature(collections)]
/// #![feature(str_casing)]
///
/// let s = "hello";
/// assert_eq!(s.to_uppercase(), "HELLO");

View File

@ -696,7 +696,7 @@ impl<T> Vec<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(append)]
/// let mut vec = vec![1, 2, 3];
/// let mut vec2 = vec![4, 5, 6];
/// vec.append(&mut vec2);
@ -840,7 +840,7 @@ impl<T> Vec<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(map_in_place)]
/// let v = vec![0, 1, 2];
/// let w = v.map_in_place(|i| i + 3);
/// assert_eq!(&w[..], &[3, 4, 5]);
@ -1082,7 +1082,7 @@ impl<T: Clone> Vec<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vec_resize)]
/// let mut vec = vec!["hello"];
/// vec.resize(3, "world");
/// assert_eq!(vec, ["hello", "world", "world"]);
@ -1111,7 +1111,7 @@ impl<T: Clone> Vec<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vec_push_all)]
/// let mut vec = vec![1];
/// vec.push_all(&[2, 3, 4]);
/// assert_eq!(vec, [1, 2, 3, 4]);

View File

@ -480,7 +480,7 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(deque_extras)]
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
@ -629,7 +629,7 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(drain)]
/// use std::collections::VecDeque;
///
/// let mut v = VecDeque::new();
@ -868,7 +868,7 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(deque_extras)]
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
@ -892,8 +892,8 @@ impl<T> VecDeque<T> {
self.pop_back()
}
/// Removes an element from anywhere in the ringbuf and returns it, replacing it with the first
/// element.
/// Removes an element from anywhere in the ringbuf and returns it,
/// replacing it with the first element.
///
/// This does not preserve ordering, but is O(1).
///
@ -902,7 +902,7 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(deque_extras)]
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
@ -1310,7 +1310,7 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(split_off)]
/// use std::collections::VecDeque;
///
/// let mut buf: VecDeque<_> = vec![1,2,3].into_iter().collect();
@ -1373,7 +1373,7 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(append)]
/// use std::collections::VecDeque;
///
/// let mut buf: VecDeque<_> = vec![1, 2, 3].into_iter().collect();
@ -1434,7 +1434,7 @@ impl<T: Clone> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(deque_extras)]
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();

View File

@ -35,7 +35,7 @@ use vec::Vec;
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut months = VecMap::new();
@ -135,7 +135,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
/// let mut map: VecMap<&str> = VecMap::new();
/// ```
@ -148,7 +148,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
/// let mut map: VecMap<&str> = VecMap::with_capacity(10);
/// ```
@ -163,7 +163,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
/// let map: VecMap<String> = VecMap::with_capacity(10);
/// assert!(map.capacity() >= 10);
@ -183,7 +183,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
/// let mut map: VecMap<&str> = VecMap::new();
/// map.reserve_len(10);
@ -208,7 +208,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
/// let mut map: VecMap<&str> = VecMap::new();
/// map.reserve_len_exact(10);
@ -248,7 +248,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -277,7 +277,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -307,7 +307,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap, append)]
/// use std::collections::VecMap;
///
/// let mut a = VecMap::new();
@ -343,7 +343,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap, split_off)]
/// use std::collections::VecMap;
///
/// let mut a = VecMap::new();
@ -400,7 +400,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap, drain)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -428,7 +428,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut a = VecMap::new();
@ -446,7 +446,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut a = VecMap::new();
@ -464,7 +464,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut a = VecMap::new();
@ -480,7 +480,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -505,7 +505,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -524,7 +524,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -552,7 +552,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -578,7 +578,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();
@ -600,7 +600,7 @@ impl<V> VecMap<V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap, entry)]
/// use std::collections::VecMap;
///
/// let mut count: VecMap<u32> = VecMap::new();
@ -779,7 +779,7 @@ impl<T> IntoIterator for VecMap<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// # #![feature(vecmap)]
/// use std::collections::VecMap;
///
/// let mut map = VecMap::new();

View File

@ -8,23 +8,52 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(bit_set_append_split_off)]
#![feature(append)]
#![feature(bit_vec_append_split_off)]
#![feature(bitset)]
#![feature(bitvec)]
#![feature(box_syntax)]
#![feature(btree_range)]
#![feature(collections)]
#![feature(collections_drain)]
#![feature(core)]
#![feature(collections_bound)]
#![feature(const_fn)]
#![feature(hash)]
#![feature(core)]
#![feature(deque_extras)]
#![feature(drain)]
#![feature(enumset)]
#![feature(hash_default)]
#![feature(into_cow)]
#![feature(iter_idx)]
#![feature(iter_order)]
#![feature(iter_arith)]
#![feature(iter_to_vec)]
#![feature(map_in_place)]
#![feature(move_from)]
#![feature(num_bits_bytes)]
#![feature(pattern)]
#![feature(permutations)]
#![feature(rand)]
#![feature(range_inclusive)]
#![feature(rustc_private)]
#![feature(slice_bytes)]
#![feature(slice_chars)]
#![feature(slice_extras)]
#![feature(slice_position_elem)]
#![feature(split_off)]
#![feature(step_by)]
#![feature(str_char)]
#![feature(str_escape)]
#![feature(str_matches)]
#![feature(str_utf16)]
#![feature(subslice_offset)]
#![feature(test)]
#![feature(unboxed_closures)]
#![feature(unicode)]
#![feature(into_cow)]
#![feature(step_by)]
#![cfg_attr(test, feature(str_char))]
#![cfg_attr(test, feature(vec_deque_retain))]
#![feature(vec_deque_retain)]
#![feature(vec_from_raw_buf)]
#![feature(vec_push_all)]
#![feature(vec_split_off)]
#![feature(vecmap)]
#[macro_use] extern crate log;

View File

@ -9,7 +9,7 @@
// except according to those terms.
use std::cmp::Ordering::{Equal, Greater, Less};
use std::str::{Utf8Error, from_utf8};
use std::str::from_utf8;
#[test]
fn test_le() {
@ -1753,6 +1753,7 @@ mod pattern {
macro_rules! make_test {
($name:ident, $p:expr, $h:expr, [$($e:expr,)*]) => {
#[allow(unused_imports)]
mod $name {
use std::str::pattern::SearchStep::{Match, Reject};
use super::{cmp_search_to_vec};

View File

@ -10,12 +10,13 @@
use std::borrow::{IntoCow, Cow};
use std::iter::repeat;
use std::str::Utf8Error;
#[allow(deprecated)]
use std::string::as_string;
use test::Bencher;
#[test]
#[allow(deprecated)]
fn test_as_string() {
let x = "foo";
assert_eq!(x, &**as_string(x));

View File

@ -10,6 +10,7 @@
use std::iter::{FromIterator, repeat};
use std::mem::size_of;
#[allow(deprecated)]
use std::vec::as_vec;
use test::Bencher;
@ -25,12 +26,14 @@ impl<'a> Drop for DropCounter<'a> {
}
#[test]
#[allow(deprecated)]
fn test_as_vec() {
let xs = [1u8, 2u8, 3u8];
assert_eq!(&**as_vec(&xs), xs);
}
#[test]
#[allow(deprecated)]
fn test_as_vec_dtor() {
let (mut count_x, mut count_y) = (0, 0);
{

View File

@ -537,8 +537,6 @@ fn test_drain() {
#[test]
fn test_from_iter() {
use std::iter;
let v = vec!(1,2,3,4,5,6,7);
let deq: VecDeque<_> = v.iter().cloned().collect();
let u: Vec<_> = deq.iter().cloned().collect();

View File

@ -221,7 +221,7 @@ impl<T:Copy> Cell<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(as_unsafe_cell)]
/// use std::cell::Cell;
///
/// let c = Cell::new(5);

View File

@ -381,7 +381,7 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(cmp_partial)]
/// use std::cmp;
///
/// assert_eq!(Some(1), cmp::partial_min(1, 2));
@ -391,7 +391,7 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
/// When comparison is impossible:
///
/// ```
/// # #![feature(core)]
/// # #![feature(cmp_partial)]
/// use std::cmp;
///
/// let result = cmp::partial_min(std::f64::NAN, 1.0);
@ -414,7 +414,7 @@ pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(cmp_partial)]
/// use std::cmp;
///
/// assert_eq!(Some(2), cmp::partial_max(1, 2));
@ -424,7 +424,7 @@ pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
/// When comparison is impossible:
///
/// ```
/// # #![feature(core)]
/// # #![feature(cmp_partial)]
/// use std::cmp;
///
/// let result = cmp::partial_max(std::f64::NAN, 1.0);

View File

@ -162,7 +162,7 @@ pub struct RadixFmt<T, R>(T, R);
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(fmt_radix)]
/// use std::fmt::radix;
/// assert_eq!(format!("{}", radix(55, 36)), "1j".to_string());
/// ```

View File

@ -16,7 +16,7 @@
//! # Examples
//!
//! ```rust
//! # #![feature(hash)]
//! # #![feature(hash_default)]
//! use std::hash::{hash, Hash, SipHasher};
//!
//! #[derive(Hash)]
@ -36,7 +36,7 @@
//! the trait `Hash`:
//!
//! ```rust
//! # #![feature(hash)]
//! # #![feature(hash_default)]
//! use std::hash::{hash, Hash, Hasher, SipHasher};
//!
//! struct Person {

View File

@ -822,7 +822,7 @@ pub trait Iterator {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(iter_min_max)]
/// use std::iter::MinMaxResult::{NoElements, OneElement, MinMax};
///
/// let a: [i32; 0] = [];
@ -894,7 +894,7 @@ pub trait Iterator {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(iter_cmp)]
/// let a = [-3_i32, 0, 1, 5, -10];
/// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
/// ```
@ -922,7 +922,7 @@ pub trait Iterator {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(iter_cmp)]
/// let a = [-3_i32, 0, 1, 5, -10];
/// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
/// ```
@ -1061,12 +1061,12 @@ pub trait Iterator {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(iter_arith)]
/// let a = [1, 2, 3, 4, 5];
/// let it = a.iter();
/// assert_eq!(it.sum::<i32>(), 15);
/// ```
#[unstable(feature="iter_sum", reason = "bounds recently changed")]
#[unstable(feature="iter_arith", reason = "bounds recently changed")]
fn sum<S=<Self as Iterator>::Item>(self) -> S where
S: Add<Self::Item, Output=S> + Zero,
Self: Sized,
@ -1079,7 +1079,7 @@ pub trait Iterator {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(iter_arith)]
/// fn factorial(n: u32) -> u32 {
/// (1..).take_while(|&i| i <= n).product()
/// }
@ -1087,7 +1087,7 @@ pub trait Iterator {
/// assert_eq!(factorial(1), 1);
/// assert_eq!(factorial(5), 120);
/// ```
#[unstable(feature="iter_product", reason = "bounds recently changed")]
#[unstable(feature="iter_arith", reason = "bounds recently changed")]
fn product<P=<Self as Iterator>::Item>(self) -> P where
P: Mul<Self::Item, Output=P> + One,
Self: Sized,
@ -1353,7 +1353,7 @@ impl<T: Clone> MinMaxResult<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(iter_min_max)]
/// use std::iter::MinMaxResult::{self, NoElements, OneElement, MinMax};
///
/// let r: MinMaxResult<i32> = NoElements;
@ -2509,7 +2509,7 @@ impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>
/// An iterator that yields sequential Fibonacci numbers, and stops on overflow.
///
/// ```
/// #![feature(core)]
/// #![feature(iter_unfold)]
/// use std::iter::Unfold;
///
/// // This iterator will yield up to the last Fibonacci number before the max

View File

@ -388,7 +388,7 @@ mod impls {
/// that function. Here is an example:
///
/// ```
/// #![feature(core)]
/// #![feature(reflect_marker)]
/// use std::marker::Reflect;
/// use std::any::Any;
/// fn foo<T:Reflect+'static>(x: &T) {

View File

@ -274,7 +274,7 @@ impl<T> Option<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(as_slice)]
/// let mut x = Some("Diamonds");
/// {
/// let v = x.as_mut_slice();

View File

@ -49,7 +49,7 @@
//! the raw pointer. It doesn't destroy `T` or deallocate any memory.
//!
//! ```
//! # #![feature(alloc)]
//! # #![feature(box_raw)]
//! use std::boxed;
//!
//! unsafe {

View File

@ -49,7 +49,7 @@ use mem;
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(raw)]
/// use std::raw::{self, Repr};
///
/// let slice: &[u16] = &[1, 2, 3, 4];
@ -98,7 +98,7 @@ impl<T> Clone for Slice<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// # #![feature(raw)]
/// use std::mem;
/// use std::raw;
///

View File

@ -420,7 +420,7 @@ impl<T, E> Result<T, E> {
/// Converts from `Result<T, E>` to `&mut [T]` (without copying)
///
/// ```
/// # #![feature(core)]
/// # #![feature(as_slice)]
/// let mut x: Result<&str, u32> = Ok("Gold");
/// {
/// let v = x.as_mut_slice();

View File

@ -19,7 +19,7 @@
//! provided beyond this module.
//!
//! ```rust
//! # #![feature(core)]
//! # #![feature(core_simd)]
//! fn main() {
//! use std::simd::f32x4;
//! let a = f32x4(40.0, 41.0, 42.0, 43.0);

View File

@ -8,27 +8,45 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
#![cfg_attr(stage0, feature(custom_attribute))]
#![feature(as_unsafe_cell)]
#![feature(borrow_state)]
#![feature(box_syntax)]
#![feature(unboxed_closures)]
#![feature(core)]
#![feature(const_fn)]
#![feature(test)]
#![feature(rand)]
#![feature(unicode)]
#![feature(std_misc)]
#![feature(libc)]
#![feature(hash)]
#![feature(unique)]
#![feature(step_by)]
#![feature(slice_patterns)]
#![feature(float_from_str_radix)]
#![feature(cell_extras)]
#![feature(cmp_partial)]
#![feature(const_fn)]
#![feature(core)]
#![feature(core_float)]
#![feature(float_extras)]
#![feature(float_from_str_radix)]
#![feature(flt2dec)]
#![feature(fmt_radix)]
#![feature(hash_default)]
#![feature(hasher_write)]
#![feature(iter_arith)]
#![feature(iter_arith)]
#![feature(iter_cmp)]
#![feature(iter_empty)]
#![feature(iter_idx)]
#![feature(iter_iterate)]
#![feature(iter_min_max)]
#![feature(iter_once)]
#![feature(iter_order)]
#![feature(iter_unfold)]
#![feature(libc)]
#![feature(nonzero)]
#![feature(num_bits_bytes)]
#![feature(ptr_as_ref)]
#![feature(rand)]
#![feature(range_inclusive)]
#![feature(raw)]
#![feature(result_expect)]
#![feature(slice_bytes)]
#![feature(slice_patterns)]
#![feature(step_by)]
#![feature(test)]
#![feature(unboxed_closures)]
#![feature(unicode)]
#![feature(unique)]
extern crate core;
extern crate test;

View File

@ -9,7 +9,6 @@
// except according to those terms.
use core::option::*;
use core::marker;
use core::mem;
use core::clone::Clone;
@ -81,7 +80,8 @@ fn test_option_dance() {
#[test] #[should_panic]
fn test_option_too_much_dance() {
let mut y = Some(marker::NoCopy);
struct A;
let mut y = Some(A);
let _y2 = y.take().unwrap();
let _y3 = y.take().unwrap();
}

View File

@ -28,7 +28,7 @@
#![feature(libc)]
#![feature(staged_api)]
#![feature(unique)]
#![cfg_attr(test, feature(rustc_private, rand, collections))]
#![cfg_attr(test, feature(rustc_private, rand, vec_push_all))]
#[cfg(test)] #[macro_use] extern crate log;

View File

@ -37,7 +37,7 @@
#![feature(staged_api)]
#![feature(step_by)]
#![cfg_attr(test, feature(test, rand, rustc_private))]
#![cfg_attr(test, feature(test, rand, rustc_private, iter_order))]
#![allow(deprecated)]

View File

@ -40,7 +40,8 @@
#![feature(hash_default)]
#![feature(hashmap_hasher)]
#![feature(into_cow)]
#![feature(iter_sum)]
#![feature(iter_cmp)]
#![feature(iter_arith)]
#![feature(libc)]
#![feature(map_in_place)]
#![feature(num_bits_bytes)]

View File

@ -19,7 +19,7 @@
#![feature(no_std)]
#![no_std]
#![unstable(feature = "rustc_private")]
#![cfg_attr(test, feature(hash))]
#![cfg_attr(test, feature(hash_default))]
//! A typesafe bitmask flag generator.

View File

@ -33,7 +33,6 @@
#![feature(rustc_private)]
#![feature(set_stdio)]
#![feature(staged_api)]
#![feature(str_casing)]
#![feature(vec_push_all)]
extern crate arena;

View File

@ -39,7 +39,6 @@
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(str_casing)]
#![feature(str_char)]
extern crate syntax;

View File

@ -30,7 +30,7 @@
#![feature(const_fn)]
#![feature(fs)]
#![feature(iter_cmp)]
#![feature(iter_sum)]
#![feature(iter_arith)]
#![feature(iter_unfold)]
#![feature(libc)]
#![feature(once_new)]

View File

@ -79,7 +79,7 @@ This API is completely unstable and subject to change.
#![feature(box_syntax)]
#![feature(drain)]
#![feature(iter_cmp)]
#![feature(iter_sum)]
#![feature(iter_arith)]
#![feature(quote)]
#![feature(ref_slice)]
#![feature(rustc_diagnostic_macros)]

View File

@ -38,7 +38,7 @@
#![feature(core_prelude)]
#![feature(core_slice_ext)]
#![feature(core_str_ext)]
#![feature(iter_sum)]
#![feature(iter_arith)]
#![feature(lang_items)]
#![feature(no_std)]
#![feature(staged_api)]

View File

@ -22,18 +22,21 @@
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(collections)]
#![feature(dynamic_lib)]
#![feature(exit_status)]
#![feature(set_stdio)]
#![feature(libc)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(std_misc)]
#![feature(test)]
#![feature(unicode)]
#![feature(owned_ascii_ext)]
#![feature(path_ext)]
#![feature(path_relative_from)]
#![feature(rustc_private)]
#![feature(set_stdio)]
#![feature(slice_extras)]
#![feature(slice_patterns)]
#![feature(staged_api)]
#![feature(subslice_offset)]
#![feature(test)]
#![feature(unicode)]
#![feature(vec_push_all)]
extern crate arena;
extern crate getopts;

View File

@ -149,8 +149,8 @@
#![feature(vec_push_all)]
#![feature(wrapping)]
#![feature(zero_one)]
#![cfg_attr(test, feature(float_from_str_radix))]
#![cfg_attr(test, feature(test, rustc_private))]
#![cfg_attr(test, feature(float_from_str_radix, range_inclusive, float_extras))]
#![cfg_attr(test, feature(test, rustc_private, float_consts))]
// Don't link to std. We are std.
#![no_std]

View File

@ -14,7 +14,7 @@
//! # Examples
//!
//! ```
//! # #![feature(std_misc)]
//! # #![feature(future)]
//! use std::sync::Future;
//!
//! // a fake, for now

View File

@ -85,6 +85,8 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
/// To recover from a poisoned mutex:
///
/// ```
/// #![feature(sync_poison)]
///
/// use std::sync::{Arc, Mutex};
/// use std::thread;
///

View File

@ -25,7 +25,7 @@ use sync::{Mutex, Condvar};
/// # Examples
///
/// ```
/// # #![feature(std_misc)]
/// # #![feature(semaphore)]
/// use std::sync::Semaphore;
///
/// // Create a semaphore that represents 5 resources

View File

@ -41,11 +41,12 @@
#![feature(fnbox)]
#![feature(iter_cmp)]
#![feature(libc)]
#![feature(rt)]
#![feature(rustc_private)]
#![feature(set_stdio)]
#![feature(slice_extras)]
#![feature(staged_api)]
#![feature(std_misc)]
#![feature(thunk)]
extern crate getopts;
extern crate serialize;

View File

@ -11,7 +11,7 @@
#![deny(warnings)]
#![feature(exit_status)]
#![feature(iter_sum)]
#![feature(iter_arith)]
#![feature(path_relative_from)]
#![feature(rustc_private)]
#![feature(rustdoc)]

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(std_misc)]
#![feature(dynamic_lib)]
// We're testing linkage visibility; the compiler warns us, but we want to
// do the runtime check that these functions aren't exported.

View File

@ -11,6 +11,7 @@
// ignore-pretty very bad with line comments
#![feature(unboxed_closures, rand, std_misc, collections, duration, duration_span)]
#![feature(bitset)]
extern crate collections;
extern crate rand;

View File

@ -10,7 +10,7 @@
// Microbenchmarks for various functions in std and extra
#![feature(rand, collections, std_misc, duration, duration_span)]
#![feature(rand, vec_push_all, duration, duration_span)]
use std::iter::repeat;
use std::mem::swap;

View File

@ -17,7 +17,7 @@
// no-pretty-expanded FIXME #15189
#![feature(duration, duration_span, std_misc)]
#![feature(duration, duration_span, future)]
use std::env;
use std::sync::{Arc, Future, Mutex, Condvar};

View File

@ -40,7 +40,7 @@
// ignore-android: FIXME(#10393) hangs without output
#![feature(box_syntax, std_misc, collections)]
#![feature(box_syntax, owned_ascii_ext, vec_push_all)]
use std::ascii::OwnedAsciiExt;
use std::env;

View File

@ -38,7 +38,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(simd, core)]
#![feature(core_simd, core)]
// ignore-pretty very bad with line comments

View File

@ -40,7 +40,7 @@
// no-pretty-expanded FIXME #15189
#![feature(core)]
#![feature(iter_cmp)]
use std::iter::repeat;
use std::sync::Arc;

View File

@ -41,14 +41,11 @@
// no-pretty-expanded FIXME #15189
#![allow(non_snake_case)]
#![feature(unboxed_closures, core, os, scoped)]
#![feature(unboxed_closures, iter_arith, core_simd, scoped)]
use std::iter::repeat;
use std::thread;
use std::mem;
use std::os;
use std::env;
use std::raw::Repr;
use std::simd::f64x2;
fn main() {

View File

@ -10,7 +10,7 @@
// Microbenchmark for the smallintmap library
#![feature(collections, duration, duration_span)]
#![feature(vecmap, duration, duration_span)]
use std::collections::VecMap;
use std::env;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax, duration, duration_span, collections)]
#![feature(box_syntax, duration, duration_span, vec_push_all)]
use std::env;
use std::thread;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(simd, core)]
#![feature(simd, core_simd)]
#![allow(dead_code)]
use std::simd::f32x4;

View File

@ -11,15 +11,10 @@
#![allow(unused_variables)]
#![allow(non_camel_case_types)]
#![deny(dead_code)]
#![feature(libc)]
#![feature(core)]
extern crate libc;
struct Foo {
x: usize,
b: bool, //~ ERROR: struct field is never used
marker: std::marker::NoCopy
}
fn field_read(f: Foo) -> usize {
@ -50,7 +45,7 @@ struct Bar {
#[repr(C)]
struct Baz {
x: libc::c_uint
x: u32,
}
fn field_match_in_let(f: Bar) -> bool {
@ -59,7 +54,7 @@ fn field_match_in_let(f: Bar) -> bool {
}
fn main() {
field_read(Foo { x: 1, b: false, marker: std::marker::NoCopy });
field_read(Foo { x: 1, b: false });
field_match_in_patterns(XYZ::Z);
field_match_in_let(Bar { x: 42, b: true, _guard: () });
let _ = Baz { x: 0 };

View File

@ -12,7 +12,7 @@
#![deny(exceeding_bitshifts)]
#![allow(unused_variables)]
#![allow(dead_code)]
#![feature(core, negate_unsigned)]
#![feature(num_bits_bytes, negate_unsigned)]
fn main() {
let n = 1u8 << 7;

View File

@ -14,8 +14,8 @@
#![allow(dead_code, unused_variables)]
#![omit_gdb_pretty_printer_section]
#![feature(std_misc, core)]
#![feature(const_fn)]
#![feature(static_mutex)]
// This test makes sure that the compiler doesn't crash when trying to assign
// debug locations to const-expressions.

View File

@ -42,7 +42,7 @@
#![allow(unused_variables)]
#![omit_gdb_pretty_printer_section]
#![feature(core)]
#![feature(core_simd)]
use std::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2};

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(std_misc)]
#![feature(dynamic_lib)]
use std::dynamic_lib::DynamicLibrary;
use std::path::Path;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(asm, core)]
#![feature(asm, core_intrinsics)]
#![crate_type="lib"]
use std::intrinsics;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(core_intrinsics)]
use std::intrinsics::{volatile_load, volatile_store};

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(std_misc, collections, catch_panic, rand)]
#![feature(std_misc, collections, catch_panic, rand, sync_poison)]
use std::__rand::{thread_rng, Rng};
use std::thread;

View File

@ -10,16 +10,14 @@
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax, collections)]
#![feature(bitvec)]
extern crate collections;
use std::collections::BitVec;
fn bitv_test() {
let mut v1: Box<_> = box BitVec::from_elem(31, false);
let v2: Box<_> = box BitVec::from_elem(31, true);
v1.union(&*v2);
let mut v1 = BitVec::from_elem(31, false);
let v2 = BitVec::from_elem(31, true);
v1.union(&v2);
}
pub fn main() {

View File

@ -9,7 +9,7 @@
// except according to those terms.
#![feature(hash)]
#![feature(hash_default)]
use std::hash::{Hash, SipHasher};

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(core, core_intrinsics)]
extern crate core;
use core::intrinsics::discriminant_value;

View File

@ -10,7 +10,7 @@
// Test a very simple custom DST coercion.
#![feature(core)]
#![feature(unsize, coerce_unsized)]
use std::ops::CoerceUnsized;
use std::marker::Unsize;

View File

@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(nonzero, core)]
extern crate core;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(raw)]
use std::mem;
use std::raw;

View File

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(lang_items, start, no_std, core, collections)]
#![feature(lang_items, start, no_std, core_slice_ext, core, collections)]
#![no_std]
extern crate std as other;

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(lang_items, start, no_std, core, collections)]
#![no_std]

View File

@ -15,10 +15,6 @@
// pretty-expanded FIXME #23616
#![feature(core)]
use std::u8;
trait IntoIterator {
type Iter: Iterator;
@ -35,7 +31,7 @@ impl<I> IntoIterator for I where I: Iterator {
fn desugared_for_loop_bad(byte: u8) -> u8 {
let mut result = 0;
let mut x = IntoIterator::into_iter(0..u8::BITS);
let mut x = IntoIterator::into_iter(0..8);
let mut y = Iterator::next(&mut x);
let mut z = y.unwrap();
byte >> z;

View File

@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(core_intrinsics)]
use std::intrinsics::assume;

View File

@ -18,7 +18,7 @@
// introduce temporaries that require cleanup, and SOURCE panics, then
// make sure the cleanups still occur.
#![feature(core, std_misc)]
#![feature(core_intrinsics, sync_poison)]
use std::cell::RefCell;
use std::intrinsics;

View File

@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(core_intrinsics)]
use std::intrinsics;

View File

@ -15,7 +15,7 @@
// when this bug was opened. The cases where the compiler
// panics before the fix have a comment.
#![feature(std_misc)]
#![feature(thunk)]
use std::thunk::Thunk;

View File

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(collections)]
#![feature(bitvec)]
use std::collections::BitVec;

View File

@ -11,7 +11,7 @@
// pretty-expanded FIXME #23616
#![forbid(warnings)]
#![feature(std_misc)]
#![feature(thunk)]
// Pretty printing tests complain about `use std::predule::*`
#![allow(unused_imports)]

View File

@ -11,9 +11,7 @@
// This test may not always fail, but it can be flaky if the race it used to
// expose is still present.
// pretty-expanded FIXME #23616
#![feature(std_misc)]
#![feature(mpsc_select)]
use std::sync::mpsc::{channel, Sender, Receiver};
use std::thread;

View File

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(core)]
#![feature(num_bits_bytes)]
use std::u8;

View File

@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(iter_arith)]
fn main() {
let x: [u64; 3] = [1, 2, 3];

View File

@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(hash)]
#![feature(hash_default)]
use std::hash::{SipHasher, hash};

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unboxed_closures, std_misc)]
#![feature(thunk)]
use std::thunk::Thunk;

View File

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(unboxed_closures, std_misc)]
#![feature(thunk)]
use std::thunk::Thunk;

View File

@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(core_intrinsics)]
struct NT(str);
struct DST { a: u32, b: str }

View File

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(std_misc)]
#![feature(thunk)]
use std::thread::Builder;
use std::thunk::Thunk;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(core_simd)]
use std::simd::i32x4;
fn main() {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(core_intrinsics)]
#![allow(warnings)]
use std::intrinsics;

View File

@ -10,9 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(core)]
use std::intrinsics;
use std::mem;
/// Returns the size of a type
pub fn size_of<T>() -> usize {
@ -32,7 +30,7 @@ pub trait TypeInfo {
impl<T> TypeInfo for T {
/// The size of the type in bytes.
fn size_of(_lame_type_hint: Option<T>) -> usize {
unsafe { intrinsics::size_of::<T>() }
mem::size_of::<T>()
}
/// Returns the size of the type of `self` in bytes.

View File

@ -11,8 +11,7 @@
// Test to see that the element type of .cloned() can be inferred
// properly. Previously this would fail to deduce the type of `sum`.
#![feature(core)]
#![feature(iter_arith)]
fn square_sum(v: &[i64]) -> i64 {
let sum: i64 = v.iter().cloned().sum();

View File

@ -13,8 +13,6 @@
// ignore-windows: std::dynamic_lib does not work on Windows well
// ignore-musl
#![feature(std_misc)]
extern crate linkage_visibility as foo;
pub fn main() {

View File

@ -13,7 +13,7 @@
// temporary. Issue #19147.
#![feature(core)]
#![feature(slice_bytes)]
use std::slice;

View File

@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core)]
#![feature(iter_min_max, cmp_partial, iter_cmp)]
use std::fmt::Debug;
use std::cmp::{self, PartialOrd, Ordering};
use std::iter::MinMaxResult::MinMax;

View File

@ -13,8 +13,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
#![allow(unknown_features)]
#![feature(box_syntax, alloc)]
#![allow(warnings)]
#![feature(box_syntax, box_heap)]
// Tests that the new `box` syntax works with unique pointers.

Some files were not shown because too many files have changed in this diff Show More