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 @@ -254,16 +254,6 @@ impl<'a> Parser<'a> {
254
254
return Ok ( ret) ;
255
255
}
256
256
257
- let mut inner_attr_replace_ranges = Vec :: new ( ) ;
258
- // Take the captured ranges for any inner attributes that we parsed.
259
- for inner_attr in ret. attrs ( ) . iter ( ) . filter ( |a| a. style == ast:: AttrStyle :: Inner ) {
260
- if let Some ( attr_range) = self . capture_state . inner_attr_ranges . remove ( & inner_attr. id ) {
261
- inner_attr_replace_ranges. push ( ( attr_range, None ) ) ;
262
- } else {
263
- self . dcx ( ) . span_delayed_bug ( inner_attr. span , "Missing token range for attribute" ) ;
264
- }
265
- }
266
-
267
257
let replace_ranges_end = self . capture_state . replace_ranges . len ( ) ;
268
258
269
259
// Capture a trailing token if requested by the callback 'f'
@@ -295,6 +285,16 @@ impl<'a> Parser<'a> {
295
285
296
286
let num_calls = end_pos - start_pos;
297
287
288
+ // Take the captured ranges for any inner attributes that we parsed.
289
+ let mut inner_attr_replace_ranges = Vec :: new ( ) ;
290
+ for inner_attr in ret. attrs ( ) . iter ( ) . filter ( |a| a. style == ast:: AttrStyle :: Inner ) {
291
+ if let Some ( attr_range) = self . capture_state . inner_attr_ranges . remove ( & inner_attr. id ) {
292
+ inner_attr_replace_ranges. push ( ( attr_range, None ) ) ;
293
+ } else {
294
+ self . dcx ( ) . span_delayed_bug ( inner_attr. span , "Missing token range for attribute" ) ;
295
+ }
296
+ }
297
+
298
298
// This is hot enough for `deep-vector` that checking the conditions for an empty iterator
299
299
// is measurably faster than actually executing the iterator.
300
300
let replace_ranges: Box < [ ReplaceRange ] > =
You can’t perform that action at this time.
0 commit comments