@@ -276,9 +276,9 @@ impl<'a> StripUnconfigured<'a> {
276276 /// Normal cfg-expansion operates on parsed AST nodes via the `configure` method
277277 fn configure_tokens ( & self , stream : & AttrAnnotatedTokenStream ) -> AttrAnnotatedTokenStream {
278278 fn can_skip ( stream : & AttrAnnotatedTokenStream ) -> bool {
279- stream. 0 . iter ( ) . all ( |( tree, _spacing ) | match tree {
279+ stream. 0 . iter ( ) . all ( |tree| match tree {
280280 AttrAnnotatedTokenTree :: Attributes ( _) => false ,
281- AttrAnnotatedTokenTree :: Token ( _ ) => true ,
281+ AttrAnnotatedTokenTree :: Token ( .. ) => true ,
282282 AttrAnnotatedTokenTree :: Delimited ( _, _, inner) => can_skip ( inner) ,
283283 } )
284284 }
@@ -290,32 +290,32 @@ impl<'a> StripUnconfigured<'a> {
290290 let trees: Vec < _ > = stream
291291 . 0
292292 . iter ( )
293- . flat_map ( |( tree, spacing ) | match tree. clone ( ) {
293+ . flat_map ( |tree| match tree. clone ( ) {
294294 AttrAnnotatedTokenTree :: Attributes ( mut data) => {
295295 data. attrs . flat_map_in_place ( |attr| self . process_cfg_attr ( attr) ) ;
296296
297297 if self . in_cfg ( & data. attrs ) {
298298 data. tokens = LazyTokenStream :: new (
299299 self . configure_tokens ( & data. tokens . create_token_stream ( ) ) ,
300300 ) ;
301- Some ( ( AttrAnnotatedTokenTree :: Attributes ( data) , * spacing ) ) . into_iter ( )
301+ Some ( AttrAnnotatedTokenTree :: Attributes ( data) ) . into_iter ( )
302302 } else {
303303 None . into_iter ( )
304304 }
305305 }
306306 AttrAnnotatedTokenTree :: Delimited ( sp, delim, mut inner) => {
307307 inner = self . configure_tokens ( & inner) ;
308- Some ( ( AttrAnnotatedTokenTree :: Delimited ( sp, delim, inner) , * spacing ) )
308+ Some ( AttrAnnotatedTokenTree :: Delimited ( sp, delim, inner) )
309309 . into_iter ( )
310310 }
311- AttrAnnotatedTokenTree :: Token ( ref token) if let TokenKind :: Interpolated ( ref nt) = token. kind => {
311+ AttrAnnotatedTokenTree :: Token ( ref token, _ ) if let TokenKind :: Interpolated ( ref nt) = token. kind => {
312312 panic ! (
313313 "Nonterminal should have been flattened at {:?}: {:?}" ,
314314 token. span, nt
315315 ) ;
316316 }
317- AttrAnnotatedTokenTree :: Token ( token) => {
318- Some ( ( AttrAnnotatedTokenTree :: Token ( token) , * spacing) ) . into_iter ( )
317+ AttrAnnotatedTokenTree :: Token ( token, spacing ) => {
318+ Some ( AttrAnnotatedTokenTree :: Token ( token, spacing) ) . into_iter ( )
319319 }
320320 } )
321321 . collect ( ) ;
@@ -404,13 +404,13 @@ impl<'a> StripUnconfigured<'a> {
404404 } ;
405405 let pound_span = pound_token. span ;
406406
407- let mut trees = vec ! [ ( AttrAnnotatedTokenTree :: Token ( pound_token) , Spacing :: Alone ) ] ;
407+ let mut trees = vec ! [ AttrAnnotatedTokenTree :: Token ( pound_token, Spacing :: Alone ) ] ;
408408 if attr. style == AttrStyle :: Inner {
409409 // For inner attributes, we do the same thing for the `!` in `#![some_attr]`
410410 let TokenTree :: Token ( bang_token @ Token { kind : TokenKind :: Not , .. } , _) = orig_trees. next ( ) . unwrap ( ) else {
411411 panic ! ( "Bad tokens for attribute {:?}" , attr) ;
412412 } ;
413- trees. push ( ( AttrAnnotatedTokenTree :: Token ( bang_token) , Spacing :: Alone ) ) ;
413+ trees. push ( AttrAnnotatedTokenTree :: Token ( bang_token, Spacing :: Alone ) ) ;
414414 }
415415 // We don't really have a good span to use for the synthesized `[]`
416416 // in `#[attr]`, so just use the span of the `#` token.
@@ -422,7 +422,7 @@ impl<'a> StripUnconfigured<'a> {
422422 . unwrap_or_else ( || panic ! ( "Missing tokens for {:?}" , item) )
423423 . create_token_stream ( ) ,
424424 ) ;
425- trees. push ( ( bracket_group, Spacing :: Alone ) ) ;
425+ trees. push ( bracket_group) ;
426426 let tokens = Some ( LazyTokenStream :: new ( AttrAnnotatedTokenStream :: new ( trees) ) ) ;
427427 let attr = attr:: mk_attr_from_item ( item, tokens, attr. style , item_span) ;
428428 if attr. has_name ( sym:: crate_type) {
0 commit comments