#![feature(rustc_diagnostic_macros)]
#![feature(unboxed_closures)]
#![feature(old_orphan_check)]
+#![feature(associated_types)]
extern crate arena;
extern crate flate;
}
}
-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);
}
}
- 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.
}
}
- 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,
}
}
- 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
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 {
}
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())
}
}
}
}
-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))
}
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()) {
}
}
-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() {
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 {
}
}
-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) => {
}
}
-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.
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() {
-> 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)))
}
}
}
-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() {
}
}
-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() {