File tree 1 file changed +10
-10
lines changed
compiler/rustc_parse/src/parser
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> {
256
256
return Ok ( ret) ;
257
257
}
258
258
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
-
269
259
let replace_ranges_end = self . capture_state . replace_ranges . len ( ) ;
270
260
271
261
assert ! (
@@ -283,6 +273,16 @@ impl<'a> Parser<'a> {
283
273
284
274
let num_calls = end_pos - start_pos;
285
275
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
+
286
286
// This is hot enough for `deep-vector` that checking the conditions for an empty iterator
287
287
// is measurably faster than actually executing the iterator.
288
288
let replace_ranges: Box < [ ReplaceRange ] > =
You can’t perform that action at this time.
0 commit comments