@@ -230,7 +230,7 @@ impl<'a> Parser<'a> {
230230 && !attrs. maybe_needs_tokens ( )
231231 && !R :: SUPPORTS_INNER_ATTRS
232232 && !( 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 ) )
234234 {
235235 return Ok ( f ( self , attrs. attrs . into ( ) ) ?. 0 ) ;
236236 }
@@ -268,7 +268,7 @@ impl<'a> Parser<'a> {
268268 // but we only bail out if there's no possibility of inner attributes
269269 // (!R::SUPPORTS_INNER_ATTRS)
270270 && !( 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 ( ) ) )
272272 {
273273 return Ok ( ret) ;
274274 }
@@ -298,19 +298,17 @@ impl<'a> Parser<'a> {
298298
299299 let num_calls = end_pos - cursor_snapshot_next_calls;
300300
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) ;
314312 if let Some ( final_attrs) = final_attrs {
315313 if matches ! ( self . capture_state. capturing, Capturing :: Yes { tokens_for_attrs: true } ) {
316314 let start_pos =
0 commit comments