File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -218,16 +218,16 @@ impl<'a> Parser<'a> {
218218 let start_token = ( self . token . clone ( ) , self . token_spacing ) ;
219219 let cursor_snapshot = self . token_cursor . clone ( ) ;
220220 let start_pos = self . num_bump_calls ;
221-
222221 let has_outer_attrs = !attrs. attrs . is_empty ( ) ;
223- let prev_capturing = std:: mem:: replace ( & mut self . capture_state . capturing , Capturing :: Yes ) ;
224222 let replace_ranges_start = self . capture_state . replace_ranges . len ( ) ;
225223
226- let ret = f ( self , attrs. attrs ) ;
227-
228- self . capture_state . capturing = prev_capturing;
229-
230- let ( mut ret, trailing) = ret?;
224+ let ( mut ret, trailing) = {
225+ let prev_capturing =
226+ std:: mem:: replace ( & mut self . capture_state . capturing , Capturing :: Yes ) ;
227+ let ret_and_trailing = f ( self , attrs. attrs ) ;
228+ self . capture_state . capturing = prev_capturing;
229+ ret_and_trailing?
230+ } ;
231231
232232 // When we're not in `capture-cfg` mode, then bail out early if:
233233 // 1. Our target doesn't support tokens at all (e.g we're parsing an `NtIdent`)
You can’t perform that action at this time.
0 commit comments