From 2257e231a7e0c455b61c60414a65e89f01cbf509 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 24 Sep 2014 10:58:53 -0700 Subject: librustc: Eliminate the `ref` syntax for unboxed closure capture clauses in favor of `move`. This breaks code that used `move` as an identifier, because it is now a keyword. Change such identifiers to not use the keyword `move`. Additionally, this breaks code that was counting on by-value or by-reference capture semantics for unboxed closures (behind the feature gate). Change `ref |:|` to `|:|` and `|:|` to `move |:|`. Part of RFC #63; part of issue #12831. [breaking-change] --- src/libsyntax/parse/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index cbc710821f9..415ff6a4097 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2084,7 +2084,7 @@ impl<'a> Parser<'a> { ExprBlock(blk)); }, token::BINOP(token::OR) | token::OROR => { - return self.parse_lambda_expr(CaptureByValue); + return self.parse_lambda_expr(CaptureByRef); }, // FIXME #13626: Should be able to stick in // token::SELF_KEYWORD_NAME @@ -2135,8 +2135,8 @@ impl<'a> Parser<'a> { hi = self.last_span.hi; } _ => { - if self.eat_keyword(keywords::Ref) { - return self.parse_lambda_expr(CaptureByRef); + if self.eat_keyword(keywords::Move) { + return self.parse_lambda_expr(CaptureByValue); } if self.eat_keyword(keywords::Proc) { let decl = self.parse_proc_decl(); -- cgit 1.4.1-3-g733a5