about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
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_codegen_ssa
parentd5ec9b458a4a584164cbfc6a53298560091ecd8c (diff)
downloadrust-8d4655d9ec9befc5cdcbb8d7a2961a75aecfc145.tar.gz
rust-8d4655d9ec9befc5cdcbb8d7a2961a75aecfc145.zip
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_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/codegen_attrs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
index 9c9e134f033..c28b0d644e6 100644
--- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
+++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -435,7 +435,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
             sym::repr => {
                 codegen_fn_attrs.alignment = if let Some(items) = attr.meta_item_list()
                     && let [item] = items.as_slice()
-                    && let Some((sym::align, literal)) = item.name_value_literal()
+                    && let Some((sym::align, literal)) = item.singleton_lit_list()
                 {
                     rustc_attr::parse_alignment(&literal.kind)
                         .map_err(|msg| {