rust-analyzer guided tuple field to named field
This commit is contained in:
parent
b08a557f80
commit
e3828777a6
16 changed files with 33 additions and 24 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue