Rollup merge of #55777 - nnethercote:less-P-in-ast, r=petrochenkov

Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.

Because it results in fewer allocations and small speedups on some
benchmarks.
This commit is contained in:
Mark Rousskov
2018-11-08 18:15:19 -07:00
committed by GitHub
6 changed files with 7 additions and 7 deletions

View File

@@ -1989,7 +1989,7 @@ impl<'a> Parser<'a> {
let minus_lo = self.span;
let minus_present = self.eat(&token::BinOp(token::Minus));
let lo = self.span;
let literal = P(self.parse_lit()?);
let literal = self.parse_lit()?;
let hi = self.prev_span;
let expr = self.mk_expr(lo.to(hi), ExprKind::Lit(literal), ThinVec::new());