]> git.lizzy.rs Git - rust.git/commitdiff
rustc: fix fallout
authorJorge Aparicio <japaricious@gmail.com>
Fri, 2 Jan 2015 04:26:38 +0000 (23:26 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Sat, 3 Jan 2015 14:34:05 +0000 (09:34 -0500)
12 files changed:
src/librustc/lib.rs
src/librustc/metadata/encoder.rs
src/librustc/middle/cfg/construct.rs
src/librustc/middle/check_match.rs
src/librustc/middle/const_eval.rs
src/librustc/middle/graph.rs
src/librustc/middle/subst.rs
src/librustc/middle/traits/select.rs
src/librustc/middle/traits/util.rs
src/librustc/middle/ty.rs
src/librustc/middle/ty_walk.rs
src/librustc/session/search_paths.rs

index cdc27244dde6ea6dde1650a75750bf0fd5944939..122171e469108639178925a2e70b62b716bb075c 100644 (file)
@@ -28,6 +28,7 @@
 #![feature(rustc_diagnostic_macros)]
 #![feature(unboxed_closures)]
 #![feature(old_orphan_check)]
+#![feature(associated_types)]
 
 extern crate arena;
 extern crate flate;
index 10383b901f38a1ad4b097946ed7d28dc47332bf7..17663a127a881ed7c62dc9daf3553697a6ce9539 100644 (file)
@@ -364,7 +364,7 @@ fn encode_enum_variant_info(ecx: &EncodeContext,
     }
 }
 
-fn encode_path<PI: Iterator<PathElem>>(rbml_w: &mut Encoder, path: PI) {
+fn encode_path<PI: Iterator<Item=PathElem>>(rbml_w: &mut Encoder, path: PI) {
     let path = path.collect::<Vec<_>>();
     rbml_w.start_tag(tag_path);
     rbml_w.wr_tagged_u32(tag_path_len, path.len() as u32);
index 92aa70548c82bdd4d4dc3e5f8838d416fb88de4b..a7b28a6323eaff7e09d43f18e6180bbad77b1003 100644 (file)
@@ -150,7 +150,7 @@ fn pat(&mut self, pat: &ast::Pat, pred: CFGIndex) -> CFGIndex {
         }
     }
 
-    fn pats_all<'b, I: Iterator<&'b P<ast::Pat>>>(&mut self,
+    fn pats_all<'b, I: Iterator<Item=&'b P<ast::Pat>>>(&mut self,
                                           pats: I,
                                           pred: CFGIndex) -> CFGIndex {
         //! Handles case where all of the patterns must match.
@@ -501,7 +501,7 @@ fn expr(&mut self, expr: &ast::Expr, pred: CFGIndex) -> CFGIndex {
         }
     }
 
-    fn call<'b, I: Iterator<&'b ast::Expr>>(&mut self,
+    fn call<'b, I: Iterator<Item=&'b ast::Expr>>(&mut self,
             call_expr: &ast::Expr,
             pred: CFGIndex,
             func_or_rcvr: &ast::Expr,
@@ -521,7 +521,7 @@ fn call<'b, I: Iterator<&'b ast::Expr>>(&mut self,
         }
     }
 
-    fn exprs<'b, I: Iterator<&'b ast::Expr>>(&mut self,
+    fn exprs<'b, I: Iterator<Item=&'b ast::Expr>>(&mut self,
                                              exprs: I,
                                              pred: CFGIndex) -> CFGIndex {
         //! Constructs graph for `exprs` evaluated in order
@@ -535,7 +535,7 @@ fn opt_expr(&mut self,
         opt_expr.iter().fold(pred, |p, e| self.expr(&**e, p))
     }
 
-    fn straightline<'b, I: Iterator<&'b ast::Expr>>(&mut self,
+    fn straightline<'b, I: Iterator<Item=&'b ast::Expr>>(&mut self,
                     expr: &ast::Expr,
                     pred: CFGIndex,
                     subexprs: I) -> CFGIndex {
index d16224ec5b8ac19c79b2db17bb51b382bd96b25d..4151f5fa627ee8568fae470d18c5b9e3f7d468e4 100644 (file)
@@ -92,7 +92,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'a> FromIterator<Vec<&'a Pat>> for Matrix<'a> {
-    fn from_iter<T: Iterator<Vec<&'a Pat>>>(iterator: T) -> Matrix<'a> {
+    fn from_iter<T: Iterator<Item=Vec<&'a Pat>>>(iterator: T) -> Matrix<'a> {
         Matrix(iterator.collect())
     }
 }
index 9fc5cb03353138b46ef8dba1d5717fd4b6532da5..96b2a62326b17f13b62ee280c50f9f95ec002d44 100644 (file)
@@ -81,7 +81,7 @@ pub fn join(a: constness, b: constness) -> constness {
     }
 }
 
-pub fn join_all<It: Iterator<constness>>(cs: It) -> constness {
+pub fn join_all<It: Iterator<Item=constness>>(cs: It) -> constness {
     cs.fold(integral_const, |a, b| join(a, b))
 }
 
index da00d737b473e785aa807d5ecf6fe8155441b522..e8efdda3888a71aee027fde148870e56112920fa 100644 (file)
@@ -305,7 +305,9 @@ pub struct DepthFirstTraversal<'g, N:'g, E:'g> {
     visited: BitvSet
 }
 
-impl<'g, N, E> Iterator<&'g N> for DepthFirstTraversal<'g, N, E> {
+impl<'g, N, E> Iterator for DepthFirstTraversal<'g, N, E> {
+    type Item = &'g N;
+
     fn next(&mut self) -> Option<&'g N> {
         while let Some(idx) = self.stack.pop() {
             if !self.visited.insert(idx.node_id()) {
index 97e74b9f6bbb9ecb8987db0c2534da9a5ba10e32..e7971a82119ecfa8b2a515b92b7e5e904b8a5127 100644 (file)
@@ -494,7 +494,9 @@ fn adjust_space(&mut self) {
     }
 }
 
-impl<'a,T> Iterator<(ParamSpace, uint, &'a T)> for EnumeratedItems<'a,T> {
+impl<'a,T> Iterator for EnumeratedItems<'a,T> {
+    type Item = (ParamSpace, uint, &'a T);
+
     fn next(&mut self) -> Option<(ParamSpace, uint, &'a T)> {
         let spaces = ParamSpace::all();
         if self.space_index < spaces.len() {
index d09f2a250b0339bb88582569898793ef8e8c3958..bd901ff431a84d001fc67e0ce307f5c1cae3eb06 100644 (file)
@@ -297,7 +297,7 @@ fn evaluate_predicates_recursively<'a,'o,I>(&mut self,
                                                 stack: Option<&TraitObligationStack<'o, 'tcx>>,
                                                 mut predicates: I)
                                                 -> EvaluationResult<'tcx>
-        where I : Iterator<&'a PredicateObligation<'tcx>>, 'tcx:'a
+        where I : Iterator<Item=&'a PredicateObligation<'tcx>>, 'tcx:'a
     {
         let mut result = EvaluatedToOk;
         for obligation in predicates {
@@ -2315,9 +2315,9 @@ fn iter(&self) -> Option<&TraitObligationStack<'o, 'tcx>> {
     }
 }
 
-impl<'o, 'tcx> Iterator<&'o TraitObligationStack<'o,'tcx>>
-           for Option<&'o TraitObligationStack<'o, 'tcx>>
-{
+impl<'o, 'tcx> Iterator for Option<&'o TraitObligationStack<'o, 'tcx>> {
+    type Item = &'o TraitObligationStack<'o,'tcx>;
+
     fn next(&mut self) -> Option<&'o TraitObligationStack<'o, 'tcx>> {
         match *self {
             Some(o) => {
index 41a59d6a5d84679b63d9a3c056bb9463a457bb87..e4578f74763298c4740e35b0bbb71782f319e49c 100644 (file)
@@ -133,7 +133,9 @@ fn push(&mut self, predicate: &ty::Predicate<'tcx>) {
     }
 }
 
-impl<'cx, 'tcx> Iterator<ty::Predicate<'tcx>> for Elaborator<'cx, 'tcx> {
+impl<'cx, 'tcx> Iterator for Elaborator<'cx, 'tcx> {
+    type Item = ty::Predicate<'tcx>;
+
     fn next(&mut self) -> Option<ty::Predicate<'tcx>> {
         loop {
             // Extract next item from top-most stack frame, if any.
@@ -197,7 +199,9 @@ pub fn transitive_bounds<'cx, 'tcx>(tcx: &'cx ty::ctxt<'tcx>,
     elaborate_trait_refs(tcx, bounds).filter_to_traits()
 }
 
-impl<'cx, 'tcx> Iterator<ty::PolyTraitRef<'tcx>> for Supertraits<'cx, 'tcx> {
+impl<'cx, 'tcx> Iterator for Supertraits<'cx, 'tcx> {
+    type Item = ty::PolyTraitRef<'tcx>;
+
     fn next(&mut self) -> Option<ty::PolyTraitRef<'tcx>> {
         loop {
             match self.elaborator.next() {
index 999bc23c27049c486bae9299948e39491549ce76..f786ef8afee99df3451a81b5c0511e5aaa221d0b 100644 (file)
@@ -3716,10 +3716,10 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>)
                                    -> Representability {
 
     // Iterate until something non-representable is found
-    fn find_nonrepresentable<'tcx, It: Iterator<Ty<'tcx>>>(cx: &ctxt<'tcx>, sp: Span,
-                                                           seen: &mut Vec<Ty<'tcx>>,
-                                                           iter: It)
-                                                           -> Representability {
+    fn find_nonrepresentable<'tcx, It: Iterator<Item=Ty<'tcx>>>(cx: &ctxt<'tcx>, sp: Span,
+                                                                seen: &mut Vec<Ty<'tcx>>,
+                                                                iter: It)
+                                                                -> Representability {
         iter.fold(Representable,
                   |r, ty| cmp::max(r, is_type_structurally_recursive(cx, sp, seen, ty)))
     }
index 406ebf4bc38a40288f08ac3e234b653e9a0dd6b4..12df36c10fc097780d0ac72398112bafca607ce7 100644 (file)
@@ -94,7 +94,9 @@ pub fn skip_current_subtree(&mut self) {
     }
 }
 
-impl<'tcx> Iterator<Ty<'tcx>> for TypeWalker<'tcx> {
+impl<'tcx> Iterator for TypeWalker<'tcx> {
+    type Item = Ty<'tcx>;
+
     fn next(&mut self) -> Option<Ty<'tcx>> {
         debug!("next(): stack={}", self.stack);
         match self.stack.pop() {
index 56b4cae2e43cfdc5e015251e12e01fb9c726e60b..14ea2d3d33a267fba12fc72cad6b67a40226e9c2 100644 (file)
@@ -53,7 +53,9 @@ pub fn iter(&self, kind: PathKind) -> Iter {
     }
 }
 
-impl<'a> Iterator<&'a Path> for Iter<'a> {
+impl<'a> Iterator for Iter<'a> {
+    type Item = &'a Path;
+
     fn next(&mut self) -> Option<&'a Path> {
         loop {
             match self.iter.next() {