This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ impl<'a> Parser<'a> {
4040 } ) )
4141 }
4242
43- /// If `force_collect` is [`ForceCollect::Yes`], forces collection of tokens regardless of whether
44- /// or not we have attributes
43+ /// If `force_collect` is [`ForceCollect::Yes`], forces collection of tokens regardless of
44+ /// whether or not we have attributes.
4545 // Public for `cfg_eval` macro expansion.
4646 pub fn parse_stmt_without_recovery (
4747 & mut self ,
@@ -51,18 +51,12 @@ impl<'a> Parser<'a> {
5151 let attrs = self . parse_outer_attributes ( ) ?;
5252 let lo = self . token . span ;
5353
54- // Don't use `maybe_whole` so that we have precise control
55- // over when we bump the parser
56- if let token:: Interpolated ( nt) = & self . token . kind
57- && let token:: NtStmt ( stmt) = & nt. 0
58- {
59- let mut stmt = stmt. clone ( ) ;
60- self . bump ( ) ;
54+ maybe_whole ! ( self , NtStmt , |stmt| {
6155 stmt. visit_attrs( |stmt_attrs| {
6256 attrs. prepend_to_nt_inner( stmt_attrs) ;
6357 } ) ;
64- return Ok ( Some ( stmt. into_inner ( ) ) ) ;
65- }
58+ Some ( stmt. into_inner( ) )
59+ } ) ;
6660
6761 if self . token . is_keyword ( kw:: Mut ) && self . is_keyword_ahead ( 1 , & [ kw:: Let ] ) {
6862 self . bump ( ) ;
You can’t perform that action at this time.
0 commit comments