diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-03-29 08:50:04 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-04-04 09:44:50 +0000 |
| commit | e3828777a6b669c33fc59f2bddde44e888d304af (patch) | |
| tree | ea3db36e58224c4e95f44dc9f1e0eddf1f8a93b5 /compiler/rustc_lint/src | |
| parent | b08a557f80865433d39d47934904a81b8ab3d720 (diff) | |
| download | rust-e3828777a6b669c33fc59f2bddde44e888d304af.tar.gz rust-e3828777a6b669c33fc59f2bddde44e888d304af.zip | |
rust-analyzer guided tuple field to named field
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/unused.rs | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index fbcc40f6657..c1b247e3d61 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -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); } diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index b620e4592f5..8f652511459 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -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, |
