@@ -253,9 +253,9 @@ impl<'a> StripUnconfigured<'a> {
253253 /// Gives a compiler warning when the `cfg_attr` contains no attributes and
254254 /// is in the original source file. Gives a compiler error if the syntax of
255255 /// the attribute is incorrect.
256- pub ( crate ) fn expand_cfg_attr ( & self , attr : & Attribute , recursive : bool ) -> Vec < Attribute > {
256+ pub ( crate ) fn expand_cfg_attr ( & self , cfg_attr : & Attribute , recursive : bool ) -> Vec < Attribute > {
257257 let Some ( ( cfg_predicate, expanded_attrs) ) =
258- rustc_parse:: parse_cfg_attr ( attr , & self . sess . psess )
258+ rustc_parse:: parse_cfg_attr ( cfg_attr , & self . sess . psess )
259259 else {
260260 return vec ! [ ] ;
261261 } ;
@@ -264,7 +264,7 @@ impl<'a> StripUnconfigured<'a> {
264264 if expanded_attrs. is_empty ( ) {
265265 self . sess . psess . buffer_lint (
266266 rustc_lint_defs:: builtin:: UNUSED_ATTRIBUTES ,
267- attr . span ,
267+ cfg_attr . span ,
268268 ast:: CRATE_NODE_ID ,
269269 BuiltinLintDiag :: CfgAttrNoAttributes ,
270270 ) ;
@@ -280,16 +280,16 @@ impl<'a> StripUnconfigured<'a> {
280280 // `#[cfg_attr(false, cfg_attr(true, some_attr))]`.
281281 expanded_attrs
282282 . into_iter ( )
283- . flat_map ( |item| self . process_cfg_attr ( & self . expand_cfg_attr_item ( attr , item) ) )
283+ . flat_map ( |item| self . process_cfg_attr ( & self . expand_cfg_attr_item ( cfg_attr , item) ) )
284284 . collect ( )
285285 } else {
286- expanded_attrs. into_iter ( ) . map ( |item| self . expand_cfg_attr_item ( attr , item) ) . collect ( )
286+ expanded_attrs. into_iter ( ) . map ( |item| self . expand_cfg_attr_item ( cfg_attr , item) ) . collect ( )
287287 }
288288 }
289289
290290 fn expand_cfg_attr_item (
291291 & self ,
292- attr : & Attribute ,
292+ cfg_attr : & Attribute ,
293293 ( item, item_span) : ( ast:: AttrItem , Span ) ,
294294 ) -> Attribute {
295295 // We are taking an attribute of the form `#[cfg_attr(pred, attr)]`
@@ -300,11 +300,11 @@ impl<'a> StripUnconfigured<'a> {
300300
301301 // Use the `#` in `#[cfg_attr(pred, attr)]` as the `#` token
302302 // for `attr` when we expand it to `#[attr]`
303- let mut orig_trees = attr . token_trees ( ) . into_iter ( ) ;
303+ let mut orig_trees = cfg_attr . token_trees ( ) . into_iter ( ) ;
304304 let TokenTree :: Token ( pound_token @ Token { kind : TokenKind :: Pound , .. } , _) =
305305 orig_trees. next ( ) . unwrap ( ) . clone ( )
306306 else {
307- panic ! ( "Bad tokens for attribute {attr :?}" ) ;
307+ panic ! ( "Bad tokens for attribute {cfg_attr :?}" ) ;
308308 } ;
309309
310310 // We don't really have a good span to use for the synthesized `[]`
@@ -318,12 +318,12 @@ impl<'a> StripUnconfigured<'a> {
318318 . unwrap_or_else ( || panic ! ( "Missing tokens for {item:?}" ) )
319319 . to_attr_token_stream ( ) ,
320320 ) ;
321- let trees = if attr . style == AttrStyle :: Inner {
321+ let trees = if cfg_attr . style == AttrStyle :: Inner {
322322 // For inner attributes, we do the same thing for the `!` in `#![some_attr]`
323323 let TokenTree :: Token ( bang_token @ Token { kind : TokenKind :: Not , .. } , _) =
324324 orig_trees. next ( ) . unwrap ( ) . clone ( )
325325 else {
326- panic ! ( "Bad tokens for attribute {attr :?}" ) ;
326+ panic ! ( "Bad tokens for attribute {cfg_attr :?}" ) ;
327327 } ;
328328 vec ! [
329329 AttrTokenTree :: Token ( pound_token, Spacing :: Joint ) ,
@@ -338,7 +338,7 @@ impl<'a> StripUnconfigured<'a> {
338338 & self . sess . psess . attr_id_generator ,
339339 item,
340340 tokens,
341- attr . style ,
341+ cfg_attr . style ,
342342 item_span,
343343 ) ;
344344 if attr. has_name ( sym:: crate_type) {
0 commit comments