1
Fork 0

rustc: fix fallout

This commit is contained in:
Jorge Aparicio 2015-01-01 23:26:38 -05:00
parent 6b19a02080
commit 62ee3f1622
12 changed files with 34 additions and 21 deletions

View file

@ -28,6 +28,7 @@
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(old_orphan_check)] #![feature(old_orphan_check)]
#![feature(associated_types)]
extern crate arena; extern crate arena;
extern crate flate; extern crate flate;

View 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<_>>(); let path = path.collect::<Vec<_>>();
rbml_w.start_tag(tag_path); rbml_w.start_tag(tag_path);
rbml_w.wr_tagged_u32(tag_path_len, path.len() as u32); rbml_w.wr_tagged_u32(tag_path_len, path.len() as u32);

View file

@ -150,7 +150,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
} }
} }
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, pats: I,
pred: CFGIndex) -> CFGIndex { pred: CFGIndex) -> CFGIndex {
//! Handles case where all of the patterns must match. //! Handles case where all of the patterns must match.
@ -501,7 +501,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
} }
} }
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, call_expr: &ast::Expr,
pred: CFGIndex, pred: CFGIndex,
func_or_rcvr: &ast::Expr, func_or_rcvr: &ast::Expr,
@ -521,7 +521,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
} }
} }
fn exprs<'b, I: Iterator<&'b ast::Expr>>(&mut self, fn exprs<'b, I: Iterator<Item=&'b ast::Expr>>(&mut self,
exprs: I, exprs: I,
pred: CFGIndex) -> CFGIndex { pred: CFGIndex) -> CFGIndex {
//! Constructs graph for `exprs` evaluated in order //! Constructs graph for `exprs` evaluated in order
@ -535,7 +535,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
opt_expr.iter().fold(pred, |p, e| self.expr(&**e, p)) 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, expr: &ast::Expr,
pred: CFGIndex, pred: CFGIndex,
subexprs: I) -> CFGIndex { subexprs: I) -> CFGIndex {

View file

@ -92,7 +92,7 @@ impl<'a> fmt::Show for Matrix<'a> {
} }
impl<'a> FromIterator<Vec<&'a Pat>> for Matrix<'a> { 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()) Matrix(iterator.collect())
} }
} }

View 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)) cs.fold(integral_const, |a, b| join(a, b))
} }

View file

@ -305,7 +305,9 @@ pub struct DepthFirstTraversal<'g, N:'g, E:'g> {
visited: BitvSet 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> { fn next(&mut self) -> Option<&'g N> {
while let Some(idx) = self.stack.pop() { while let Some(idx) = self.stack.pop() {
if !self.visited.insert(idx.node_id()) { if !self.visited.insert(idx.node_id()) {

View file

@ -494,7 +494,9 @@ impl<'a,T> EnumeratedItems<'a,T> {
} }
} }
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)> { fn next(&mut self) -> Option<(ParamSpace, uint, &'a T)> {
let spaces = ParamSpace::all(); let spaces = ParamSpace::all();
if self.space_index < spaces.len() { if self.space_index < spaces.len() {

View file

@ -297,7 +297,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
stack: Option<&TraitObligationStack<'o, 'tcx>>, stack: Option<&TraitObligationStack<'o, 'tcx>>,
mut predicates: I) mut predicates: I)
-> EvaluationResult<'tcx> -> EvaluationResult<'tcx>
where I : Iterator<&'a PredicateObligation<'tcx>>, 'tcx:'a where I : Iterator<Item=&'a PredicateObligation<'tcx>>, 'tcx:'a
{ {
let mut result = EvaluatedToOk; let mut result = EvaluatedToOk;
for obligation in predicates { for obligation in predicates {
@ -2315,9 +2315,9 @@ impl<'o, 'tcx> TraitObligationStack<'o, 'tcx> {
} }
} }
impl<'o, 'tcx> Iterator<&'o TraitObligationStack<'o,'tcx>> impl<'o, 'tcx> Iterator for Option<&'o TraitObligationStack<'o, 'tcx>> {
for Option<&'o TraitObligationStack<'o, 'tcx>> type Item = &'o TraitObligationStack<'o,'tcx>;
{
fn next(&mut self) -> Option<&'o TraitObligationStack<'o, 'tcx>> { fn next(&mut self) -> Option<&'o TraitObligationStack<'o, 'tcx>> {
match *self { match *self {
Some(o) => { Some(o) => {

View file

@ -133,7 +133,9 @@ impl<'cx, 'tcx> Elaborator<'cx, '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>> { fn next(&mut self) -> Option<ty::Predicate<'tcx>> {
loop { loop {
// Extract next item from top-most stack frame, if any. // 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() 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>> { fn next(&mut self) -> Option<ty::PolyTraitRef<'tcx>> {
loop { loop {
match self.elaborator.next() { match self.elaborator.next() {

View file

@ -3716,7 +3716,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>)
-> Representability { -> Representability {
// Iterate until something non-representable is found // Iterate until something non-representable is found
fn find_nonrepresentable<'tcx, It: Iterator<Ty<'tcx>>>(cx: &ctxt<'tcx>, sp: Span, fn find_nonrepresentable<'tcx, It: Iterator<Item=Ty<'tcx>>>(cx: &ctxt<'tcx>, sp: Span,
seen: &mut Vec<Ty<'tcx>>, seen: &mut Vec<Ty<'tcx>>,
iter: It) iter: It)
-> Representability { -> Representability {

View file

@ -94,7 +94,9 @@ impl<'tcx> TypeWalker<'tcx> {
} }
} }
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>> { fn next(&mut self) -> Option<Ty<'tcx>> {
debug!("next(): stack={}", self.stack); debug!("next(): stack={}", self.stack);
match self.stack.pop() { match self.stack.pop() {

View file

@ -53,7 +53,9 @@ impl SearchPaths {
} }
} }
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> { fn next(&mut self) -> Option<&'a Path> {
loop { loop {
match self.iter.next() { match self.iter.next() {