diff options
| author | bors <bors@rust-lang.org> | 2014-09-16 23:26:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-16 23:26:11 +0000 |
| commit | 0e784e16840e8a0c623cc6166de26da9334db3d6 (patch) | |
| tree | cb9ee37525225e3cbe4cda7d7954f2f72d24acb8 /src/libsyntax/parse | |
| parent | ceb9bbfbf5933f9df238fecdd14e75304439c4f4 (diff) | |
| parent | fc525eeb4ec3443d29bce677f589b19f31c189bb (diff) | |
| download | rust-0e784e16840e8a0c623cc6166de26da9334db3d6.tar.gz rust-0e784e16840e8a0c623cc6166de26da9334db3d6.zip | |
auto merge of #17268 : aturon/rust/mut-conventions, r=alexcrichton
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. Additional details and motivation in the RFC. Note that the iterator *type* names are not changed by this RFC; those are awaiting a separate RFC for standardization. Closes #13660 Closes #16810 [breaking-change]
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 84484841613..a6a2ecb199a 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1295,7 +1295,7 @@ impl<'a> Parser<'a> { let (inner_attrs, body) = p.parse_inner_attrs_and_block(); let mut attrs = attrs; - attrs.extend(inner_attrs.move_iter()); + attrs.extend(inner_attrs.into_iter()); ProvidedMethod(P(ast::Method { attrs: attrs, id: ast::DUMMY_NODE_ID, @@ -1404,7 +1404,7 @@ impl<'a> Parser<'a> { if ts.len() == 1 && !one_tuple { self.expect(&token::RPAREN); - TyParen(ts.move_iter().nth(0).unwrap()) + TyParen(ts.into_iter().nth(0).unwrap()) } else { let t = TyTup(ts); self.expect(&token::RPAREN); @@ -2011,7 +2011,7 @@ impl<'a> Parser<'a> { self.commit_expr_expecting(&**es.last().unwrap(), token::RPAREN); return if es.len() == 1 && !trailing_comma { - self.mk_expr(lo, hi, ExprParen(es.move_iter().nth(0).unwrap())) + self.mk_expr(lo, hi, ExprParen(es.into_iter().nth(0).unwrap())) } else { self.mk_expr(lo, hi, ExprTup(es)) } @@ -3500,7 +3500,7 @@ impl<'a> Parser<'a> { } = self.parse_items_and_view_items(first_item_attrs, false, false); - for item in items.move_iter() { + for item in items.into_iter() { let span = item.span; let decl = P(spanned(span.lo, span.hi, DeclItem(item))); stmts.push(P(spanned(span.lo, span.hi, StmtDecl(decl, ast::DUMMY_NODE_ID)))); @@ -3898,7 +3898,7 @@ impl<'a> Parser<'a> { "variadic function must be declared with at least one named argument"); } - let args = args.move_iter().map(|x| x.unwrap()).collect(); + let args = args.into_iter().map(|x| x.unwrap()).collect(); (args, variadic) } @@ -4958,7 +4958,7 @@ impl<'a> Parser<'a> { seq_sep_trailing_allowed(token::COMMA), |p| p.parse_ty(true) ); - for ty in arg_tys.move_iter() { + for ty in arg_tys.into_iter() { args.push(ast::VariantArg { ty: ty, id: ast::DUMMY_NODE_ID, @@ -5057,7 +5057,7 @@ impl<'a> Parser<'a> { self.bump(); let mut attrs = attrs; mem::swap(&mut item.attrs, &mut attrs); - item.attrs.extend(attrs.move_iter()); + item.attrs.extend(attrs.into_iter()); return IoviItem(P(item)); } None => {} @@ -5408,7 +5408,7 @@ impl<'a> Parser<'a> { let path = ast::Path { span: span, global: false, - segments: path.move_iter().map(|identifier| { + segments: path.into_iter().map(|identifier| { ast::PathSegment { identifier: identifier, lifetimes: Vec::new(), @@ -5443,7 +5443,7 @@ impl<'a> Parser<'a> { let path = ast::Path { span: mk_sp(lo, self.span.hi), global: false, - segments: path.move_iter().map(|identifier| { + segments: path.into_iter().map(|identifier| { ast::PathSegment { identifier: identifier, lifetimes: Vec::new(), @@ -5461,7 +5461,7 @@ impl<'a> Parser<'a> { let path = ast::Path { span: mk_sp(lo, self.span.hi), global: false, - segments: path.move_iter().map(|identifier| { + segments: path.into_iter().map(|identifier| { ast::PathSegment { identifier: identifier, lifetimes: Vec::new(), @@ -5483,7 +5483,7 @@ impl<'a> Parser<'a> { let path = ast::Path { span: mk_sp(lo, self.span.hi), global: false, - segments: path.move_iter().map(|identifier| { + segments: path.into_iter().map(|identifier| { ast::PathSegment { identifier: identifier, lifetimes: Vec::new(), |
