diff options
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/deriving/decodable.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic.rs | 7 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 5 |
3 files changed, 7 insertions, 10 deletions
diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs index 30dd89b02f1..77b5bf5bf2c 100644 --- a/src/libsyntax/ext/deriving/decodable.rs +++ b/src/libsyntax/ext/deriving/decodable.rs @@ -14,7 +14,6 @@ encodable.rs for more. */ use std::vec; -use std::uint; use ast::{MetaItem, item, expr, m_mutbl}; use codemap::span; @@ -84,7 +83,7 @@ fn decodable_substructure(cx: @ExtCtxt, span: span, cx.expr_ident(span, substr.type_ident) } else { let mut fields = vec::with_capacity(n); - for uint::range(0, n) |i| { + foreach i in range(0, n) { fields.push(getarg(fmt!("_field%u", i).to_managed(), i)); } cx.expr_call_ident(span, substr.type_ident, fields) @@ -126,7 +125,7 @@ fn decodable_substructure(cx: @ExtCtxt, span: span, cx.expr_ident(span, name) } else { let mut fields = vec::with_capacity(n); - for uint::range(0, n) |i| { + foreach i in range(0u, n) { fields.push(getarg(i)); } cx.expr_call_ident(span, name, fields) diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index cb74f152c1e..715e3013444 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -170,7 +170,6 @@ use ext::build::AstBuilder; use codemap::{span,respan}; use opt_vec; -use std::uint; use std::vec; pub use self::ty::*; @@ -580,13 +579,13 @@ impl<'self> MethodDef<'self> { let mut raw_fields = ~[]; // ~[[fields of self], // [fields of next Self arg], [etc]] let mut patterns = ~[]; - for uint::range(0, self_args.len()) |i| { + foreach i in range(0u, self_args.len()) { let (pat, ident_expr) = create_struct_pattern(cx, span, type_ident, struct_def, fmt!("__self_%u", i), ast::m_imm); patterns.push(pat); raw_fields.push(ident_expr); - }; + } // transpose raw_fields let fields = match raw_fields { @@ -992,7 +991,7 @@ fn create_enum_variant_pattern(cx: @ExtCtxt, let mut paths = ~[]; let mut ident_expr = ~[]; - for uint::range(0, variant_args.len()) |i| { + foreach i in range(0u, variant_args.len()) { let path = cx.path_ident(span, cx.ident_of(fmt!("%s_%u", prefix, i))); diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index ad26d7b3f7e..982e605af22 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -21,7 +21,6 @@ use parse::token::{Token, EOF, to_str, nonterminal, get_ident_interner, ident_to use parse::token; use std::hashmap::HashMap; -use std::uint; use std::vec; /* This is an Earley-like parser, without support for in-grammar nonterminals, @@ -280,7 +279,7 @@ pub fn parse( // most of the time. // Only touch the binders we have actually bound - for uint::range(ei.match_lo, ei.match_hi) |idx| { + foreach idx in range(ei.match_lo, ei.match_hi) { let sub = ei.matches[idx].clone(); new_pos.matches[idx] .push(@matched_seq(sub, @@ -321,7 +320,7 @@ pub fn parse( let mut new_ei = ei.clone(); new_ei.idx += 1u; //we specifically matched zero repeats. - for uint::range(match_idx_lo, match_idx_hi) |idx| { + foreach idx in range(match_idx_lo, match_idx_hi) { new_ei.matches[idx].push(@matched_seq(~[], sp)); } |
