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:
Nicholas Nethercote
2018-11-08 15:55:52 +11:00
parent 0117b42f66
commit 706c2ad651
6 changed files with 7 additions and 7 deletions

View File

@@ -1957,7 +1957,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());