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(unboxed_closures)]
#![feature(old_orphan_check)]
#![feature(associated_types)]
extern crate arena;
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<_>>();
rbml_w.start_tag(tag_path);
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,
pred: CFGIndex) -> CFGIndex {
//! 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,
pred: CFGIndex,
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,
pred: CFGIndex) -> CFGIndex {
//! 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))
}
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 {

View File

@ -92,7 +92,7 @@ impl<'a> fmt::Show 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())
}
}

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))
}

View 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()) {

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)> {
let spaces = ParamSpace::all();
if self.space_index < spaces.len() {

View File

@ -297,7 +297,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
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 @@ impl<'o, 'tcx> 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) => {

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>> {
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() {

View 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)))
}

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>> {
debug!("next(): stack={}", self.stack);
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> {
loop {
match self.iter.next() {