File tree 1 file changed +5
-11
lines changed
compiler/rustc_parse/src/parser
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> {
40
40
} ) )
41
41
}
42
42
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.
45
45
// Public for `cfg_eval` macro expansion.
46
46
pub fn parse_stmt_without_recovery (
47
47
& mut self ,
@@ -51,18 +51,12 @@ impl<'a> Parser<'a> {
51
51
let attrs = self . parse_outer_attributes ( ) ?;
52
52
let lo = self . token . span ;
53
53
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| {
61
55
stmt. visit_attrs( |stmt_attrs| {
62
56
attrs. prepend_to_nt_inner( stmt_attrs) ;
63
57
} ) ;
64
- return Ok ( Some ( stmt. into_inner ( ) ) ) ;
65
- }
58
+ Some ( stmt. into_inner( ) )
59
+ } ) ;
66
60
67
61
if self . token . is_keyword ( kw:: Mut ) && self . is_keyword_ahead ( 1 , & [ kw:: Let ] ) {
68
62
self . bump ( ) ;
You can’t perform that action at this time.
0 commit comments