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)]`).
This commit is contained in:
parent
d5ec9b458a
commit
8d4655d9ec
3 changed files with 5 additions and 4 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue