diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/codemap.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 3 | ||||
| -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 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 3 |
6 files changed, 10 insertions, 16 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index d89057890f1..04b9fdce666 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -22,7 +22,6 @@ source code snippets, etc. */ use std::cmp; -use std::uint; use extra::serialize::{Encodable, Decodable, Encoder, Decoder}; pub trait Pos { @@ -364,7 +363,7 @@ impl CodeMap { let lo = self.lookup_char_pos(sp.lo); let hi = self.lookup_char_pos(sp.hi); let mut lines = ~[]; - for uint::range(lo.line - 1u, hi.line as uint) |i| { + foreach i in range(lo.line - 1u, hi.line as uint) { lines.push(i); }; return @FileLines {file: lo.file, lines: lines}; diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 0fb28596e11..01f55e8c4f4 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -12,7 +12,6 @@ use codemap::{Pos, span}; use codemap; use std::io; -use std::uint; use std::local_data; use extra::term; @@ -306,7 +305,7 @@ fn highlight_lines(cm: @codemap::CodeMap, s.push_char(' '); } let orig = fm.get_line(lines.lines[0] as int); - for uint::range(0u,left-skip) |pos| { + foreach pos in range(0u, left-skip) { let curChar = (orig[pos] as char); // Whenever a tab occurs on the previous line, we insert one on // the error-point-squiggly-line as well (instead of a space). 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)); } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index a4666847f8c..d24dd86fda1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -29,7 +29,6 @@ use print::pprust; use std::io; use std::u64; -use std::uint; // The @ps is stored here to prevent recursive type. pub enum ann_node<'self> { @@ -1791,7 +1790,7 @@ pub fn print_generics(s: @ps, generics: &ast::Generics) { } let mut ints = ~[]; - for uint::range(0, total) |i| { + foreach i in range(0u, total) { ints.push(i); } |
