diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2018-11-08 15:55:52 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2018-11-08 19:00:55 +1100 |
| commit | 706c2ad651c1b2db95aeb4efc9acf5d0b42d5640 (patch) | |
| tree | 8852c2ef20b2e81f13296d9d2ead43f52735f5de /src/libsyntax/parse | |
| parent | 0117b42f66632f1f0fc08f1cdd8ca264c10bba94 (diff) | |
| download | rust-706c2ad651c1b2db95aeb4efc9acf5d0b42d5640.tar.gz rust-706c2ad651c1b2db95aeb4efc9acf5d0b42d5640.zip | |
Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.
Because it results in fewer allocations and small speedups on some benchmarks.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c453b4b5597..ae5c936a70d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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()); |
