about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-22 23:07:55 -0700
committerbors <bors@rust-lang.org>2013-06-22 23:07:55 -0700
commit3b126e4d6dda1eac3881b8ca19772071997a7992 (patch)
treeb72e78c12760059cc28b9d7d88afaee2f434bf1d /src/libsyntax/parse
parentfc83d82fec5bc338ffa4aaf00ca2aef6bfd473a4 (diff)
parentd2e9912aea87f9b1812a0f44e093c0405848f7ce (diff)
downloadrust-3b126e4d6dda1eac3881b8ca19772071997a7992.tar.gz
rust-3b126e4d6dda1eac3881b8ca19772071997a7992.zip
auto merge of #7274 : thestinger/rust/size_hint, r=huonw
I ran into a weird lifetime bug blocking updating the `collect` method to use `FromIterator`, but everything here works fine.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer.rs2
-rw-r--r--src/libsyntax/parse/parser.rs10
2 files changed, 7 insertions, 5 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index ccc1cbd0d89..84915b6403a 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -835,7 +835,7 @@ mod test {
     // check that the given reader produces the desired stream
     // of tokens (stop checking after exhausting the expected vec)
     fn check_tokenization (env: Env, expected: ~[token::Token]) {
-        for expected.each |expected_tok| {
+        for expected.iter().advance |expected_tok| {
             let TokenAndSpan {tok:actual_tok, sp: _} =
                 env.string_reader.next_token();
             assert_eq!(&actual_tok,expected_tok);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4e52b6b7367..753c69b23d6 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2746,7 +2746,7 @@ impl Parser {
         } = self.parse_items_and_view_items(first_item_attrs,
                                             false, false);
 
-        for items.each |item| {
+        for items.iter().advance |item| {
             let decl = @spanned(item.span.lo, item.span.hi, decl_item(*item));
             stmts.push(@spanned(item.span.lo, item.span.hi,
                                 stmt_decl(decl, self.get_id())));
@@ -3356,7 +3356,8 @@ impl Parser {
             is_tuple_like = false;
             fields = ~[];
             while *self.token != token::RBRACE {
-                for self.parse_struct_decl_field().each |struct_field| {
+                let r = self.parse_struct_decl_field();
+                for r.iter().advance |struct_field| {
                     fields.push(*struct_field)
                 }
             }
@@ -3825,7 +3826,8 @@ impl Parser {
     fn parse_struct_def(&self) -> @struct_def {
         let mut fields: ~[@struct_field] = ~[];
         while *self.token != token::RBRACE {
-            for self.parse_struct_decl_field().each |struct_field| {
+            let r = self.parse_struct_decl_field();
+            for r.iter().advance |struct_field| {
                 fields.push(*struct_field);
             }
         }
@@ -3865,7 +3867,7 @@ impl Parser {
                     seq_sep_trailing_disallowed(token::COMMA),
                     |p| p.parse_ty(false)
                 );
-                for arg_tys.each |ty| {
+                for arg_tys.iter().advance |ty| {
                     args.push(ast::variant_arg {
                         ty: *ty,
                         id: self.get_id(),