about summary refs log tree commit diff
path: root/compiler/rustc_parse
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-07-10 15:11:57 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-07-10 15:11:57 +1000
commitd8b6aa6d0dabc0c102f16f9f9bb35f687a63101c (patch)
treee02567e4c14b51839722b8ae2e85759c89ddc4d8 /compiler/rustc_parse
parentfee152556fda2260a17fa24cea21d18b57c8460d (diff)
downloadrust-d8b6aa6d0dabc0c102f16f9f9bb35f687a63101c.tar.gz
rust-d8b6aa6d0dabc0c102f16f9f9bb35f687a63101c.zip
Use `cfg_attr` as a name more.
In various functions where the attribute being processed is known to be
a `#[cfg_attr(...)]` attribute. I find this a helpful reminder.
Diffstat (limited to 'compiler/rustc_parse')
-rw-r--r--compiler/rustc_parse/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs
index 5522127be83..4454747ea02 100644
--- a/compiler/rustc_parse/src/lib.rs
+++ b/compiler/rustc_parse/src/lib.rs
@@ -157,14 +157,14 @@ pub fn fake_token_stream_for_crate(psess: &ParseSess, krate: &ast::Crate) -> Tok
 }
 
 pub fn parse_cfg_attr(
-    attr: &Attribute,
+    cfg_attr: &Attribute,
     psess: &ParseSess,
 ) -> Option<(MetaItem, Vec<(AttrItem, Span)>)> {
     const CFG_ATTR_GRAMMAR_HELP: &str = "#[cfg_attr(condition, attribute, other_attribute, ...)]";
     const CFG_ATTR_NOTE_REF: &str = "for more information, visit \
         <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>";
 
-    match attr.get_normal_item().args {
+    match cfg_attr.get_normal_item().args {
         ast::AttrArgs::Delimited(ast::DelimArgs { dspan, delim, ref tokens })
             if !tokens.is_empty() =>
         {
@@ -180,7 +180,7 @@ pub fn parse_cfg_attr(
         }
         _ => {
             psess.dcx().emit_err(errors::MalformedCfgAttr {
-                span: attr.span,
+                span: cfg_attr.span,
                 sugg: CFG_ATTR_GRAMMAR_HELP,
             });
         }