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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user