about summary refs log tree commit diff
path: root/compiler/rustc_attr
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-04-24 14:25:59 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-04-24 16:28:34 +1000
commit8d4655d9ec9befc5cdcbb8d7a2961a75aecfc145 (patch)
treec210a771356b687af4caf3c6671cf92f8215788b /compiler/rustc_attr
parentd5ec9b458a4a584164cbfc6a53298560091ecd8c (diff)
Rename `NestedMetaItem::name_value_literal`.
It's a highly misleading name, because it's completely different to
`MetaItem::name_value_literal`. Specifically, it doesn't match
`MetaItemKind::NameValue` (e.g. `#[foo = 3]`), it matches
`MetaItemKind::List` (e.g. `#[foo(3)]`).
Diffstat (limited to 'compiler/rustc_attr')
-rw-r--r--compiler/rustc_attr/src/builtin.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs
index 439f13e7635..1c2077372e1 100644
--- a/compiler/rustc_attr/src/builtin.rs
+++ b/compiler/rustc_attr/src/builtin.rs
@@ -986,7 +986,7 @@ pub fn parse_repr_attr(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
                     recognised = true;
                     acc.push(h);
                 }
-            } else if let Some((name, value)) = item.name_value_literal() {
+            } else if let Some((name, value)) = item.singleton_lit_list() {
                 let mut literal_error = None;
                 let mut err_span = item.span();
                 if name == sym::align {