1
Fork 0

rust-analyzer guided tuple field to named field

This commit is contained in:
Oli Scherer 2023-03-29 08:50:04 +00:00
parent b08a557f80
commit e3828777a6
16 changed files with 33 additions and 24 deletions

View file

@ -43,7 +43,6 @@ use crate::{
types::{transparent_newtype_field, CItemKind},
EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext,
};
use ast::Static;
use hir::IsAsync;
use rustc_ast::attr;
use rustc_ast::tokenstream::{TokenStream, TokenTree};
@ -371,7 +370,7 @@ impl EarlyLintPass for UnsafeCode {
}
}
ast::ItemKind::Static(Static(..)) => {
ast::ItemKind::Static(..) => {
if let Some(attr) = attr::find_by_name(&it.attrs, sym::no_mangle) {
self.report_unsafe(cx, attr.span, BuiltinUnsafe::NoMangleStatic);
}

View file

@ -805,7 +805,7 @@ trait UnusedDelimLint {
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) {
use ast::ItemKind::*;
if let Const(.., Some(expr)) | Static(ast::Static(.., Some(expr))) = &item.kind {
if let Const(.., Some(expr)) | Static(ast::Static { expr: Some(expr), .. }) = &item.kind {
self.check_unused_delims_expr(
cx,
expr,