From c3b904704031047ef9e1f7906d3faee15778ffe5 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Mon, 3 Mar 2014 18:41:47 +1100 Subject: syntax: make match arms store the expr directly. Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an `ast::Block` (for historical reasons, AIUI), so we might as just store that expr directly. Closes #3085. --- src/libsyntax/parse/parser.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 2557af5e436..341151117f0 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2634,16 +2634,7 @@ impl Parser { self.eat(&token::COMMA); } - let blk = P(ast::Block { - view_items: Vec::new(), - stmts: Vec::new(), - expr: Some(expr), - id: ast::DUMMY_NODE_ID, - rules: DefaultBlock, - span: expr.span, - }); - - arms.push(ast::Arm { pats: pats, guard: guard, body: blk }); + arms.push(ast::Arm { pats: pats, guard: guard, body: expr }); } let hi = self.span.hi; self.bump(); -- cgit 1.4.1-3-g733a5