diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-04-06 12:08:39 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-04-07 12:51:50 +1000 |
| commit | d9592c2d9f0db851b090c10c0cc3560b87fc7789 (patch) | |
| tree | d2c6f22ebb2cc5e244b5c15609622c363146efdd /compiler/rustc_parse/src/parser/expr.rs | |
| parent | c2afaba465e0bf44b9b37beba8d908b78dcdadc7 (diff) | |
Shrink `Nonterminal`.
By heap allocating the argument within `NtPath`, `NtVis`, and `NtStmt`. This slightly reduces cumulative and peak allocation amounts, most notably on `deep-vector`.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 7978a1a7f5f..7efc0ca2da2 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -41,7 +41,7 @@ macro_rules! maybe_whole_expr { return Ok(e); } token::NtPath(path) => { - let path = path.clone(); + let path = (**path).clone(); $p.bump(); return Ok($p.mk_expr( $p.prev_token.span, |
