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`.
This commit is contained in:
@@ -54,7 +54,7 @@ impl<'a> Parser<'a> {
|
||||
stmt.visit_attrs(|stmt_attrs| {
|
||||
attrs.prepend_to_nt_inner(stmt_attrs);
|
||||
});
|
||||
return Ok(Some(stmt));
|
||||
return Ok(Some(stmt.into_inner()));
|
||||
}
|
||||
|
||||
Ok(Some(if self.token.is_keyword(kw::Let) {
|
||||
@@ -535,7 +535,7 @@ impl<'a> Parser<'a> {
|
||||
recover: AttemptLocalParseRecovery,
|
||||
) -> PResult<'a, Option<Stmt>> {
|
||||
// Skip looking for a trailing semicolon when we have an interpolated statement.
|
||||
maybe_whole!(self, NtStmt, |x| Some(x));
|
||||
maybe_whole!(self, NtStmt, |x| Some(x.into_inner()));
|
||||
|
||||
let Some(mut stmt) = self.parse_stmt_without_recovery(true, ForceCollect::No)? else {
|
||||
return Ok(None);
|
||||
|
||||
Reference in New Issue
Block a user