@@ -230,7 +230,7 @@ impl<'a> Parser<'a> {
230
230
&& !attrs. maybe_needs_tokens ( )
231
231
&& !R :: SUPPORTS_INNER_ATTRS
232
232
&& !( matches ! ( self . capture_state. capturing, Capturing :: Yes { tokens_for_attrs: true } )
233
- && ast:: attr :: has_cfg_or_cfg_any ( & attrs. attrs ) )
233
+ && ast:: ast_like :: has_cfg_or_cfg_any ( & attrs. attrs ) )
234
234
{
235
235
return Ok ( f ( self , attrs. attrs . into ( ) ) ?. 0 ) ;
236
236
}
@@ -268,7 +268,7 @@ impl<'a> Parser<'a> {
268
268
// but we only bail out if there's no possibility of inner attributes
269
269
// (!R::SUPPORTS_INNER_ATTRS)
270
270
&& !( matches ! ( self . capture_state. capturing, Capturing :: Yes { tokens_for_attrs: true } )
271
- && ast:: attr :: has_cfg_or_cfg_any ( ret. attrs ( ) ) )
271
+ && ast:: ast_like :: has_cfg_or_cfg_any ( ret. attrs ( ) ) )
272
272
{
273
273
return Ok ( ret) ;
274
274
}
@@ -298,19 +298,17 @@ impl<'a> Parser<'a> {
298
298
299
299
let num_calls = end_pos - cursor_snapshot_next_calls;
300
300
301
- let make_lazy = || {
302
- LazyTokenStream :: new ( LazyTokenStreamImpl {
303
- start_token,
304
- num_calls : num_calls. try_into ( ) . unwrap ( ) ,
305
- cursor_snapshot,
306
- desugar_doc_comments : self . desugar_doc_comments ,
307
- append_unglued_token : self . token_cursor . append_unglued_token . clone ( ) ,
308
- replace_ranges : replace_ranges. into ( ) ,
309
- start_calls : cursor_snapshot_next_calls. try_into ( ) . unwrap ( ) ,
310
- } )
311
- } ;
312
-
313
- let final_attrs: Option < AttributesData > = ret. finalize_tokens ( make_lazy) ;
301
+ let tokens = LazyTokenStream :: new ( LazyTokenStreamImpl {
302
+ start_token,
303
+ num_calls : num_calls. try_into ( ) . unwrap ( ) ,
304
+ cursor_snapshot,
305
+ desugar_doc_comments : self . desugar_doc_comments ,
306
+ append_unglued_token : self . token_cursor . append_unglued_token . clone ( ) ,
307
+ replace_ranges : replace_ranges. into ( ) ,
308
+ start_calls : cursor_snapshot_next_calls. try_into ( ) . unwrap ( ) ,
309
+ } ) ;
310
+
311
+ let final_attrs: Option < AttributesData > = ret. finalize_tokens ( tokens) ;
314
312
if let Some ( final_attrs) = final_attrs {
315
313
if matches ! ( self . capture_state. capturing, Capturing :: Yes { tokens_for_attrs: true } ) {
316
314
let start_pos =
0 commit comments