1
Fork 0

Rename NestedMetaItem::[Ll]iteral as NestedMetaItem::[Ll]it.

We already use a mix of `Literal` and `Lit`. The latter is better
because it is shorter without causing any ambiguity.
This commit is contained in:
Nicholas Nethercote 2022-11-24 15:00:09 +11:00
parent 1c65264f3c
commit a60e337c88
19 changed files with 34 additions and 41 deletions

View file

@ -462,8 +462,8 @@ impl LateLintPass<'_> for BadOptAccess {
let Some(attr) = cx.tcx.get_attr(field.did, sym::rustc_lint_opt_deny_field_access) &&
let Some(items) = attr.meta_item_list() &&
let Some(item) = items.first() &&
let Some(literal) = item.literal() &&
let ast::LitKind::Str(val, _) = literal.kind
let Some(lit) = item.lit() &&
let ast::LitKind::Str(val, _) = lit.kind
{
cx.struct_span_lint(BAD_OPT_ACCESS, expr.span, val.as_str(), |lint|
lint