about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/stmt.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-07 12:52:32 +0000
committerbors <bors@rust-lang.org>2022-04-07 12:52:32 +0000
commitfa723160318fac5f3fa6f4141cfc41c0606a3008 (patch)
treea41085f587d3243ca62065f0ee2555d9dd892a41 /compiler/rustc_parse/src/parser/stmt.rs
parented6c958ee4bf081deec951996ace9c508360c1d9 (diff)
parentd9592c2d9f0db851b090c10c0cc3560b87fc7789 (diff)
downloadrust-fa723160318fac5f3fa6f4141cfc41c0606a3008.tar.gz
rust-fa723160318fac5f3fa6f4141cfc41c0606a3008.zip
Auto merge of #95715 - nnethercote:shrink-Nonterminal, r=davidtwco
Shrink `Nonterminal`

Small consistency and performance improvements.

r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index e3bcd945db7..5b7ae5f7a7b 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -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);