]> git.lizzy.rs Git - rust.git/commitdiff
syntax: fix fallout
authorJorge Aparicio <japaricious@gmail.com>
Fri, 2 Jan 2015 03:55:09 +0000 (22:55 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Sat, 3 Jan 2015 14:34:05 +0000 (09:34 -0500)
src/libsyntax/ast_map/mod.rs
src/libsyntax/attr.rs
src/libsyntax/ext/base.rs
src/libsyntax/owned_slice.rs
src/libsyntax/parse/mod.rs
src/libsyntax/util/small_vector.rs

index b5395d09ca7d4adb2b90a34fdae0bee7a1343615..b1799fc2718ff905b093e9243cc970c68bd7d4bc 100644 (file)
@@ -61,7 +61,9 @@ struct LinkedPathNode<'a> {
 
 type LinkedPath<'a> = Option<&'a LinkedPathNode<'a>>;
 
-impl<'a> Iterator<PathElem> for LinkedPath<'a> {
+impl<'a> Iterator for LinkedPath<'a> {
+    type Item = PathElem;
+
     fn next(&mut self) -> Option<PathElem> {
         match *self {
             Some(node) => {
@@ -77,7 +79,9 @@ fn next(&mut self) -> Option<PathElem> {
 #[deriving(Clone)]
 pub struct Values<'a, T:'a>(pub slice::Iter<'a, T>);
 
-impl<'a, T: Copy> Iterator<T> for Values<'a, T> {
+impl<'a, T: Copy> Iterator for Values<'a, T> {
+    type Item = T;
+
     fn next(&mut self) -> Option<T> {
         let &Values(ref mut items) = self;
         items.next().map(|&x| x)
@@ -87,7 +91,7 @@ fn next(&mut self) -> Option<T> {
 /// The type of the iterator used by with_path.
 pub type PathElems<'a, 'b> = iter::Chain<Values<'a, PathElem>, LinkedPath<'b>>;
 
-pub fn path_to_string<PI: Iterator<PathElem>>(path: PI) -> String {
+pub fn path_to_string<PI: Iterator<Item=PathElem>>(path: PI) -> String {
     let itr = token::get_ident_interner();
 
     path.fold(String::new(), |mut s, e| {
@@ -629,7 +633,9 @@ fn matches_names(&self, parent_of_n: NodeId, name: Name) -> bool {
     }
 }
 
-impl<'a, 'ast> Iterator<NodeId> for NodesMatchingSuffix<'a, 'ast> {
+impl<'a, 'ast> Iterator for NodesMatchingSuffix<'a, 'ast> {
+    type Item = NodeId;
+
     fn next(&mut self) -> Option<NodeId> {
         loop {
             let idx = self.idx;
index df820b40cb6de63d8aaf2d754cfa60f65e8c5128..92818f063416060ff464c668edc14262bdab826c 100644 (file)
@@ -359,7 +359,7 @@ pub enum StabilityLevel {
 
 pub fn find_stability_generic<'a,
                               AM: AttrMetaMethods,
-                              I: Iterator<&'a AM>>
+                              I: Iterator<Item=&'a AM>>
                              (mut attrs: I)
                              -> Option<(Stability, &'a AM)> {
     for attr in attrs {
index efb4867a016be02ba14721e4c6181b4a45216eba..e56194c95cd5b07f5accacf99beff09ae3b99bd4 100644 (file)
@@ -220,7 +220,7 @@ pub struct MacItems {
 }
 
 impl MacItems {
-    pub fn new<I: Iterator<P<ast::Item>>>(it: I) -> Box<MacResult+'static> {
+    pub fn new<I: Iterator<Item=P<ast::Item>>>(it: I) -> Box<MacResult+'static> {
         box MacItems { items: it.collect() } as Box<MacResult+'static>
     }
 }
index bc2e09231159aea3b1ad396278530fad6ab67655..38c26e8967140c7c353b80eb9ef5e5c63adca9cb 100644 (file)
@@ -77,7 +77,7 @@ fn clone(&self) -> OwnedSlice<T> {
 }
 
 impl<T> FromIterator<T> for OwnedSlice<T> {
-    fn from_iter<I: Iterator<T>>(iter: I) -> OwnedSlice<T> {
+    fn from_iter<I: Iterator<Item=T>>(iter: I) -> OwnedSlice<T> {
         OwnedSlice::from_vec(iter.collect())
     }
 }
index 88c485a07acdf290a28ef5dd66c543b841c6ae76..8598571e5c37a7f41cebe2aeb1942da2a1968387 100644 (file)
@@ -598,7 +598,7 @@ pub fn binary_lit(lit: &str) -> Rc<Vec<u8>> {
     let error = |&: i| format!("lexer should have rejected {} at {}", lit, i);
 
     /// Eat everything up to a non-whitespace
-    fn eat<'a, I: Iterator<(uint, u8)>>(it: &mut iter::Peekable<(uint, u8), I>) {
+    fn eat<'a, I: Iterator<Item=(uint, u8)>>(it: &mut iter::Peekable<(uint, u8), I>) {
         loop {
             match it.peek().map(|x| x.1) {
                 Some(b' ') | Some(b'\n') | Some(b'\r') | Some(b'\t') => {
index 953a7ae960e8c029d27721fbb9105ea7463bab8f..b68c9926391d70b2808c113e66e39bc0fd400127 100644 (file)
@@ -30,7 +30,7 @@ enum SmallVectorRepr<T> {
 }
 
 impl<T> FromIterator<T> for SmallVector<T> {
-    fn from_iter<I: Iterator<T>>(iter: I) -> SmallVector<T> {
+    fn from_iter<I: Iterator<Item=T>>(iter: I) -> SmallVector<T> {
         let mut v = SmallVector::zero();
         v.extend(iter);
         v
@@ -38,7 +38,7 @@ fn from_iter<I: Iterator<T>>(iter: I) -> SmallVector<T> {
 }
 
 impl<T> Extend<T> for SmallVector<T> {
-    fn extend<I: Iterator<T>>(&mut self, mut iter: I) {
+    fn extend<I: Iterator<Item=T>>(&mut self, mut iter: I) {
         for val in iter {
             self.push(val);
         }
@@ -147,7 +147,9 @@ enum IntoIterRepr<T> {
     ManyIterator(vec::IntoIter<T>),
 }
 
-impl<T> Iterator<T> for IntoIter<T> {
+impl<T> Iterator for IntoIter<T> {
+    type Item = T;
+
     fn next(&mut self) -> Option<T> {
         match self.repr {
             ZeroIterator => None,