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