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 +10
-10
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -256,16 +256,6 @@ impl<'a> Parser<'a> {
256256 return Ok ( ret) ;
257257 }
258258
259- let mut inner_attr_replace_ranges = Vec :: new ( ) ;
260- // Take the captured ranges for any inner attributes that we parsed.
261- for inner_attr in ret. attrs ( ) . iter ( ) . filter ( |a| a. style == ast:: AttrStyle :: Inner ) {
262- if let Some ( attr_range) = self . capture_state . inner_attr_ranges . remove ( & inner_attr. id ) {
263- inner_attr_replace_ranges. push ( ( attr_range, None ) ) ;
264- } else {
265- self . dcx ( ) . span_delayed_bug ( inner_attr. span , "Missing token range for attribute" ) ;
266- }
267- }
268-
269259 let replace_ranges_end = self . capture_state . replace_ranges . len ( ) ;
270260
271261 assert ! (
@@ -283,6 +273,16 @@ impl<'a> Parser<'a> {
283273
284274 let num_calls = end_pos - start_pos;
285275
276+ // Take the captured ranges for any inner attributes that we parsed.
277+ let mut inner_attr_replace_ranges = Vec :: new ( ) ;
278+ for inner_attr in ret. attrs ( ) . iter ( ) . filter ( |a| a. style == ast:: AttrStyle :: Inner ) {
279+ if let Some ( attr_range) = self . capture_state . inner_attr_ranges . remove ( & inner_attr. id ) {
280+ inner_attr_replace_ranges. push ( ( attr_range, None ) ) ;
281+ } else {
282+ self . dcx ( ) . span_delayed_bug ( inner_attr. span , "Missing token range for attribute" ) ;
283+ }
284+ }
285+
286286 // This is hot enough for `deep-vector` that checking the conditions for an empty iterator
287287 // is measurably faster than actually executing the iterator.
288288 let replace_ranges: Box < [ ReplaceRange ] > =
You can’t perform that action at this time.
0 commit comments