use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::fmt;
use core::cmp::Ordering;
-use core::default::Default;
use core::mem::{min_align_of, size_of};
use core::mem;
use core::nonzero::NonZero;
use core::any::Any;
use core::cmp::Ordering;
-use core::default::Default;
use core::fmt;
use core::hash::{self, Hash};
use core::mem;
use core::prelude::*;
-use core::default::Default;
-use core::iter::{FromIterator, IntoIterator};
+use core::iter::{FromIterator};
use core::mem::{zeroed, replace, swap};
use core::ptr;
Iter { iter: self.data.iter() }
}
- /// Creates a consuming iterator, that is, one that moves each value out of
- /// the binary heap in arbitrary order. The binary heap cannot be used
- /// after calling this.
- ///
- /// # Examples
- ///
- /// ```
- /// # #![feature(collections)]
- /// use std::collections::BinaryHeap;
- /// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);
- ///
- /// // Print 1, 2, 3, 4 in arbitrary order
- /// for x in heap.into_iter() {
- /// // x has type i32, not &i32
- /// println!("{}", x);
- /// }
- /// ```
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- IntoIter { iter: self.data.into_iter() }
- }
-
/// Returns the greatest item in the binary heap, or `None` if it is empty.
///
/// # Examples
type Item = T;
type IntoIter = IntoIter<T>;
+ /// Creates a consuming iterator, that is, one that moves each value out of
+ /// the binary heap in arbitrary order. The binary heap cannot be used
+ /// after calling this.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// # #![feature(collections)]
+ /// use std::collections::BinaryHeap;
+ /// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);
+ ///
+ /// // Print 1, 2, 3, 4 in arbitrary order
+ /// for x in heap.into_iter() {
+ /// // x has type i32, not &i32
+ /// println!("{}", x);
+ /// }
+ /// ```
fn into_iter(self) -> IntoIter<T> {
- self.into_iter()
+ IntoIter { iter: self.data.into_iter() }
}
}
use core::cmp::Ordering;
use core::cmp;
-use core::default::Default;
use core::fmt;
use core::hash;
use core::iter::RandomAccessIterator;
use core::iter::{Chain, Enumerate, Repeat, Skip, Take, repeat, Cloned};
-use core::iter::{self, FromIterator, IntoIterator};
+use core::iter::{self, FromIterator};
use core::ops::Index;
use core::slice;
use core::{u8, u32, usize};
use core::prelude::*;
use core::cmp::Ordering;
-use core::default::Default;
use core::fmt::Debug;
use core::hash::{Hash, Hasher};
-use core::iter::{Map, FromIterator, IntoIterator};
+use core::iter::{Map, FromIterator};
use core::ops::Index;
use core::{iter, fmt, mem, usize};
use Bound::{self, Included, Excluded, Unbounded};
type Item = (K, V);
type IntoIter = IntoIter<K, V>;
+ /// Gets an owning iterator over the entries of the map.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use std::collections::BTreeMap;
+ ///
+ /// let mut map = BTreeMap::new();
+ /// map.insert(1, "a");
+ /// map.insert(2, "b");
+ /// map.insert(3, "c");
+ ///
+ /// for (key, value) in map.into_iter() {
+ /// println!("{}: {}", key, value);
+ /// }
+ /// ```
fn into_iter(self) -> IntoIter<K, V> {
- self.into_iter()
+ let len = self.len();
+ let mut lca = VecDeque::new();
+ lca.push_back(Traverse::traverse(self.root));
+ IntoIter {
+ inner: AbsIter {
+ traversals: lca,
+ size: len,
+ }
+ }
}
}
}
}
- /// Gets an owning iterator over the entries of the map.
- ///
- /// # Examples
- ///
- /// ```
- /// use std::collections::BTreeMap;
- ///
- /// let mut map = BTreeMap::new();
- /// map.insert(1, "a");
- /// map.insert(2, "b");
- /// map.insert(3, "c");
- ///
- /// for (key, value) in map.into_iter() {
- /// println!("{}: {}", key, value);
- /// }
- /// ```
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<K, V> {
- let len = self.len();
- let mut lca = VecDeque::new();
- lca.push_back(Traverse::traverse(self.root));
- IntoIter {
- inner: AbsIter {
- traversals: lca,
- size: len,
- }
- }
- }
-
/// Gets an iterator over the keys of the map.
///
/// # Examples
use core::prelude::*;
use core::cmp::Ordering::{self, Less, Greater, Equal};
-use core::default::Default;
use core::fmt::Debug;
use core::fmt;
-use core::iter::{Peekable, Map, FromIterator, IntoIterator};
+use core::iter::{Peekable, Map, FromIterator};
use core::ops::{BitOr, BitAnd, BitXor, Sub};
use borrow::Borrow;
pub fn iter(&self) -> Iter<T> {
Iter { iter: self.map.keys() }
}
-
- /// Gets an iterator for moving out the BtreeSet's contents.
- ///
- /// # Examples
- ///
- /// ```
- /// # #![feature(core)]
- /// use std::collections::BTreeSet;
- ///
- /// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
- ///
- /// let v: Vec<usize> = set.into_iter().collect();
- /// assert_eq!(v, [1, 2, 3, 4]);
- /// ```
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- fn first<A, B>((a, _): (A, B)) -> A { a }
- let first: fn((T, ())) -> T = first; // coerce to fn pointer
-
- IntoIter { iter: self.map.into_iter().map(first) }
- }
}
impl<T: Ord> BTreeSet<T> {
type Item = T;
type IntoIter = IntoIter<T>;
+ /// Gets an iterator for moving out the BtreeSet's contents.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// # #![feature(core)]
+ /// use std::collections::BTreeSet;
+ ///
+ /// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
+ ///
+ /// let v: Vec<usize> = set.into_iter().collect();
+ /// assert_eq!(v, [1, 2, 3, 4]);
+ /// ```
fn into_iter(self) -> IntoIter<T> {
- self.into_iter()
+ fn first<A, B>((a, _): (A, B)) -> A { a }
+ let first: fn((T, ())) -> T = first; // coerce to fn pointer
+
+ IntoIter { iter: self.map.into_iter().map(first) }
}
}
use core::prelude::*;
use core::marker;
use core::fmt;
-use core::iter::{FromIterator, IntoIterator};
+use core::iter::{FromIterator};
use core::ops::{Sub, BitOr, BitAnd, BitXor};
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
use alloc::boxed::Box;
use core::cmp::Ordering;
-use core::default::Default;
use core::fmt;
use core::hash::{Hasher, Hash};
-use core::iter::{self, FromIterator, IntoIterator};
+use core::iter::{self, FromIterator};
use core::mem;
use core::ptr;
}
}
- /// Consumes the list into an iterator yielding elements by value.
- #[inline]
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- IntoIter{list: self}
- }
-
/// Returns `true` if the `LinkedList` is empty.
///
/// This operation should compute in O(1) time.
type Item = T;
type IntoIter = IntoIter<T>;
+ /// Consumes the list into an iterator yielding elements by value.
+ #[inline]
fn into_iter(self) -> IntoIter<T> {
- self.into_iter()
+ IntoIter{list: self}
}
}
#[cfg(test)]
mod test {
use std::clone::Clone;
- use std::iter::Iterator;
+ use std::iter::{Iterator, IntoIterator};
use std::option::Option::{Some, None, self};
use std::__rand::{thread_rng, Rng};
use std::thread;
use core::prelude::*;
-use core::default::Default;
use core::fmt;
use core::hash;
-use core::iter::{IntoIterator, FromIterator};
+use core::iter::FromIterator;
use core::mem;
use core::ops::{self, Deref, Add, Index};
use core::ptr;
use core::slice;
+#[allow(deprecated)] use core::str::Str;
use core::str::pattern::Pattern;
use unicode::str as unicode_str;
use unicode::str::Utf16Item;
use alloc::heap::{EMPTY, allocate, reallocate, deallocate};
use core::cmp::max;
use core::cmp::Ordering;
-use core::default::Default;
use core::fmt;
use core::hash::{self, Hash};
use core::intrinsics::assume;
-use core::iter::{repeat, FromIterator, IntoIterator};
+use core::iter::{repeat, FromIterator};
use core::marker::PhantomData;
use core::mem;
use core::ops::{Index, IndexMut, Deref, Add};
use core::ops;
use core::ptr;
use core::ptr::Unique;
-use core::slice;
+use core::slice::{self, AsSlice};
use core::isize;
use core::usize;
&mut self[..]
}
- /// Creates a consuming iterator, that is, one that moves each value out of
- /// the vector (from start to end). The vector cannot be used after calling
- /// this.
- ///
- /// # Examples
- ///
- /// ```
- /// let v = vec!["a".to_string(), "b".to_string()];
- /// for s in v.into_iter() {
- /// // s has type String, not &String
- /// println!("{}", s);
- /// }
- /// ```
- #[inline]
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- unsafe {
- let ptr = *self.ptr;
- assume(!ptr.is_null());
- let cap = self.cap;
- let begin = ptr as *const T;
- let end = if mem::size_of::<T>() == 0 {
- (ptr as usize + self.len()) as *const T
- } else {
- ptr.offset(self.len() as isize) as *const T
- };
- mem::forget(self);
- IntoIter { allocation: ptr, cap: cap, ptr: begin, end: end }
- }
- }
-
/// Sets the length of a vector.
///
/// This will explicitly set the size of the vector, without actually
type Item = T;
type IntoIter = IntoIter<T>;
+ /// Creates a consuming iterator, that is, one that moves each value out of
+ /// the vector (from start to end). The vector cannot be used after calling
+ /// this.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// let v = vec!["a".to_string(), "b".to_string()];
+ /// for s in v.into_iter() {
+ /// // s has type String, not &String
+ /// println!("{}", s);
+ /// }
+ /// ```
+ #[inline]
fn into_iter(self) -> IntoIter<T> {
- self.into_iter()
+ unsafe {
+ let ptr = *self.ptr;
+ assume(!ptr.is_null());
+ let cap = self.cap;
+ let begin = ptr as *const T;
+ let end = if mem::size_of::<T>() == 0 {
+ (ptr as usize + self.len()) as *const T
+ } else {
+ ptr.offset(self.len() as isize) as *const T
+ };
+ mem::forget(self);
+ IntoIter { allocation: ptr, cap: cap, ptr: begin, end: end }
+ }
}
}
use core::prelude::*;
use core::cmp::Ordering;
-use core::default::Default;
use core::fmt;
-use core::iter::{self, repeat, FromIterator, IntoIterator, RandomAccessIterator};
+use core::iter::{self, repeat, FromIterator, RandomAccessIterator};
use core::mem;
use core::ops::{Index, IndexMut};
use core::ptr::{self, Unique};
}
}
- /// Consumes the list into a front-to-back iterator yielding elements by value.
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- IntoIter {
- inner: self,
- }
- }
-
/// Returns a pair of slices which contain, in order, the contents of the
/// `VecDeque`.
#[inline]
type Item = T;
type IntoIter = IntoIter<T>;
+ /// Consumes the list into a front-to-back iterator yielding elements by
+ /// value.
fn into_iter(self) -> IntoIter<T> {
- self.into_iter()
+ IntoIter {
+ inner: self,
+ }
}
}
use core::prelude::*;
use core::cmp::{max, Ordering};
-use core::default::Default;
use core::fmt;
use core::hash::{Hash, Hasher};
-use core::iter::{Enumerate, FilterMap, Map, FromIterator, IntoIterator};
+use core::iter::{Enumerate, FilterMap, Map, FromIterator};
use core::iter;
use core::mem::{replace, swap};
use core::ops::{Index, IndexMut};
}
}
- /// Returns an iterator visiting all key-value pairs in ascending order of
- /// the keys, consuming the original `VecMap`.
- /// The iterator's element type is `(usize, &'r V)`.
- ///
- /// # Examples
- ///
- /// ```
- /// # #![feature(collections)]
- /// use std::collections::VecMap;
- ///
- /// let mut map = VecMap::new();
- /// map.insert(1, "a");
- /// map.insert(3, "c");
- /// map.insert(2, "b");
- ///
- /// let vec: Vec<(usize, &str)> = map.into_iter().collect();
- ///
- /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]);
- /// ```
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<V> {
- fn filter<A>((i, v): (usize, Option<A>)) -> Option<(usize, A)> {
- v.map(|v| (i, v))
- }
- let filter: fn((usize, Option<V>)) -> Option<(usize, V)> = filter; // coerce to fn ptr
-
- IntoIter { iter: self.v.into_iter().enumerate().filter_map(filter) }
- }
-
/// Moves all elements from `other` into the map while overwriting existing keys.
///
/// # Examples
type Item = (usize, T);
type IntoIter = IntoIter<T>;
+ /// Returns an iterator visiting all key-value pairs in ascending order of
+ /// the keys, consuming the original `VecMap`.
+ /// The iterator's element type is `(usize, &'r V)`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// # #![feature(collections)]
+ /// use std::collections::VecMap;
+ ///
+ /// let mut map = VecMap::new();
+ /// map.insert(1, "a");
+ /// map.insert(3, "c");
+ /// map.insert(2, "b");
+ ///
+ /// let vec: Vec<(usize, &str)> = map.into_iter().collect();
+ ///
+ /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]);
+ /// ```
fn into_iter(self) -> IntoIter<T> {
- self.into_iter()
+ fn filter<A>((i, v): (usize, Option<A>)) -> Option<(usize, A)> {
+ v.map(|v| (i, v))
+ }
+ let filter: fn((usize, Option<T>)) -> Option<(usize, T)> = filter; // coerce to fn ptr
+
+ IntoIter { iter: self.v.into_iter().enumerate().filter_map(filter) }
}
}
use prelude::*;
-use default::Default;
use mem;
pub use self::sip::SipHasher;
#![allow(deprecated)] // until the next snapshot for inherent wrapping ops
use prelude::*;
-use default::Default;
use super::Hasher;
/// An implementation of SipHash 2-4.
IterMut { inner: Item { opt: self.as_mut() } }
}
- /// Returns a consuming iterator over the possibly contained value.
- ///
- /// # Examples
- ///
- /// ```
- /// let x = Some("string");
- /// let v: Vec<&str> = x.into_iter().collect();
- /// assert_eq!(v, ["string"]);
- ///
- /// let x = None;
- /// let v: Vec<&str> = x.into_iter().collect();
- /// assert!(v.is_empty());
- /// ```
- #[inline]
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- IntoIter { inner: Item { opt: self } }
- }
-
/////////////////////////////////////////////////////////////////////////
// Boolean operations on the values, eager and lazy
/////////////////////////////////////////////////////////////////////////
fn default() -> Option<T> { None }
}
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<T> IntoIterator for Option<T> {
+ type Item = T;
+ type IntoIter = IntoIter<T>;
+
+ /// Returns a consuming iterator over the possibly contained value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// let x = Some("string");
+ /// let v: Vec<&str> = x.into_iter().collect();
+ /// assert_eq!(v, ["string"]);
+ ///
+ /// let x = None;
+ /// let v: Vec<&str> = x.into_iter().collect();
+ /// assert!(v.is_empty());
+ /// ```
+ #[inline]
+ fn into_iter(self) -> IntoIter<T> {
+ IntoIter { inner: Item { opt: self } }
+ }
+}
+
/////////////////////////////////////////////////////////////////////////////
// The Option Iterators
/////////////////////////////////////////////////////////////////////////////
pub use clone::Clone;
pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
pub use convert::{AsRef, AsMut, Into, From};
+pub use default::Default;
+pub use iter::IntoIterator;
pub use iter::{Iterator, DoubleEndedIterator, Extend, ExactSizeIterator};
pub use option::Option::{self, Some, None};
pub use result::Result::{self, Ok, Err};
pub use slice::SliceExt;
pub use str::StrExt;
-
-#[allow(deprecated)] pub use slice::AsSlice;
-#[allow(deprecated)] pub use str::Str;
IterMut { inner: self.as_mut().ok() }
}
- /// Returns a consuming iterator over the possibly contained value.
- ///
- /// # Examples
- ///
- /// ```
- /// let x: Result<u32, &str> = Ok(5);
- /// let v: Vec<u32> = x.into_iter().collect();
- /// assert_eq!(v, [5]);
- ///
- /// let x: Result<u32, &str> = Err("nothing!");
- /// let v: Vec<u32> = x.into_iter().collect();
- /// assert_eq!(v, []);
- /// ```
- #[inline]
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- IntoIter { inner: self.ok() }
- }
-
////////////////////////////////////////////////////////////////////////
// Boolean operations on the values, eager and lazy
/////////////////////////////////////////////////////////////////////////
}
}
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<T, E> IntoIterator for Result<T, E> {
+ type Item = T;
+ type IntoIter = IntoIter<T>;
+
+ /// Returns a consuming iterator over the possibly contained value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// let x: Result<u32, &str> = Ok(5);
+ /// let v: Vec<u32> = x.into_iter().collect();
+ /// assert_eq!(v, [5]);
+ ///
+ /// let x: Result<u32, &str> = Err("nothing!");
+ /// let v: Vec<u32> = x.into_iter().collect();
+ /// assert_eq!(v, []);
+ /// ```
+ #[inline]
+ fn into_iter(self) -> IntoIter<T> {
+ IntoIter { inner: self.ok() }
+ }
+}
+
/////////////////////////////////////////////////////////////////////////////
// The Result Iterators
/////////////////////////////////////////////////////////////////////////////
use core::prelude::*;
use {Rng, SeedableRng};
-use core::default::Default;
/// How many bytes of entropy the underling RNG is allowed to generate
/// before it is reseeded.
use core::iter::{order, repeat};
use super::{ReseedingRng, ReseedWithDefault};
- use std::default::Default;
use {SeedableRng, Rng};
struct Counter {
IterMut { inner: self.table.iter_mut() }
}
- /// Creates a consuming iterator, that is, one that moves each key-value
- /// pair out of the map in arbitrary order. The map cannot be used after
- /// calling this.
- ///
- /// # Examples
- ///
- /// ```
- /// use std::collections::HashMap;
- ///
- /// let mut map = HashMap::new();
- /// map.insert("a", 1);
- /// map.insert("b", 2);
- /// map.insert("c", 3);
- ///
- /// // Not possible with .iter()
- /// let vec: Vec<(&str, isize)> = map.into_iter().collect();
- /// ```
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<K, V> {
- fn last_two<A, B, C>((_, b, c): (A, B, C)) -> (B, C) { (b, c) }
- let last_two: fn((SafeHash, K, V)) -> (K, V) = last_two;
-
- IntoIter {
- inner: self.table.into_iter().map(last_two)
- }
- }
-
/// Gets the given key's corresponding entry in the map for in-place manipulation.
#[stable(feature = "rust1", since = "1.0.0")]
pub fn entry(&mut self, key: K) -> Entry<K, V> {
type Item = (K, V);
type IntoIter = IntoIter<K, V>;
+ /// Creates a consuming iterator, that is, one that moves each key-value
+ /// pair out of the map in arbitrary order. The map cannot be used after
+ /// calling this.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use std::collections::HashMap;
+ ///
+ /// let mut map = HashMap::new();
+ /// map.insert("a", 1);
+ /// map.insert("b", 2);
+ /// map.insert("c", 3);
+ ///
+ /// // Not possible with .iter()
+ /// let vec: Vec<(&str, isize)> = map.into_iter().collect();
+ /// ```
fn into_iter(self) -> IntoIter<K, V> {
- self.into_iter()
+ fn last_two<A, B, C>((_, b, c): (A, B, C)) -> (B, C) { (b, c) }
+ let last_two: fn((SafeHash, K, V)) -> (K, V) = last_two;
+
+ IntoIter {
+ inner: self.table.into_iter().map(last_two)
+ }
}
}
Iter { iter: self.map.keys() }
}
- /// Creates a consuming iterator, that is, one that moves each value out
- /// of the set in arbitrary order. The set cannot be used after calling
- /// this.
- ///
- /// # Examples
- ///
- /// ```
- /// use std::collections::HashSet;
- /// let mut set = HashSet::new();
- /// set.insert("a".to_string());
- /// set.insert("b".to_string());
- ///
- /// // Not possible to collect to a Vec<String> with a regular `.iter()`.
- /// let v: Vec<String> = set.into_iter().collect();
- ///
- /// // Will print in an arbitrary order.
- /// for x in v.iter() {
- /// println!("{}", x);
- /// }
- /// ```
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn into_iter(self) -> IntoIter<T> {
- fn first<A, B>((a, _): (A, B)) -> A { a }
- let first: fn((T, ())) -> T = first;
-
- IntoIter { iter: self.map.into_iter().map(first) }
- }
-
/// Visit the values representing the difference.
///
/// # Examples
type Item = T;
type IntoIter = IntoIter<T>;
+ /// Creates a consuming iterator, that is, one that moves each value out
+ /// of the set in arbitrary order. The set cannot be used after calling
+ /// this.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use std::collections::HashSet;
+ /// let mut set = HashSet::new();
+ /// set.insert("a".to_string());
+ /// set.insert("b".to_string());
+ ///
+ /// // Not possible to collect to a Vec<String> with a regular `.iter()`.
+ /// let v: Vec<String> = set.into_iter().collect();
+ ///
+ /// // Will print in an arbitrary order.
+ /// for x in v.iter() {
+ /// println!("{}", x);
+ /// }
+ /// ```
fn into_iter(self) -> IntoIter<T> {
- self.into_iter()
+ fn first<A, B>((a, _): (A, B)) -> A { a }
+ let first: fn((T, ())) -> T = first;
+
+ IntoIter { iter: self.map.into_iter().map(first) }
}
}
use prelude::v1::*;
-use iter::IntoIterator;
use error::Error;
use ffi::{OsStr, OsString};
use fmt;
use ascii::*;
use borrow::{Borrow, IntoCow, ToOwned, Cow};
use cmp;
-use iter::{self, IntoIterator};
+use iter;
use mem;
use ops::{self, Deref};
use string::String;
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)] pub use boxed::Box;
#[stable(feature = "rust1", since = "1.0.0")]
+#[doc(no_inline)] pub use borrow::ToOwned;
+#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)] pub use clone::Clone;
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
-#[unstable(feature = "convert")]
+#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)] pub use convert::{AsRef, AsMut, Into, From};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use iter::DoubleEndedIterator;
+#[doc(no_inline)] pub use default::Default;
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use iter::ExactSizeIterator;
+#[doc(no_inline)] pub use iter::{Iterator, Extend, IntoIterator};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use iter::{Iterator, Extend};
+#[doc(no_inline)] pub use iter::{DoubleEndedIterator, ExactSizeIterator};
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)] pub use option::Option::{self, Some, None};
#[stable(feature = "rust1", since = "1.0.0")]
use cmp;
use fmt;
use hash::{Hash, Hasher};
-use iter::{FromIterator, IntoIterator};
+use iter::FromIterator;
use mem;
#[allow(deprecated)] // Int
use num::Int;
trait IntoIterator {
type Iter: Iterator;
- fn into_iter(self) -> Self::Iter;
+ fn into_iter2(self) -> Self::Iter;
}
impl<I> IntoIterator for I where I: Iterator {
type Iter = I;
- fn into_iter(self) -> I {
+ fn into_iter2(self) -> I {
self
}
}
fn desugared_for_loop_bad<T>(v: Vec<T>) {
- match IntoIterator::into_iter(v.iter()) {
+ match IntoIterator::into_iter2(v.iter()) {
mut iter => {
loop {
match ::std::iter::Iterator::next(&mut iter) {