diff options
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 16 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/internal.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/lib.rs | 1 |
3 files changed, 10 insertions, 11 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index d0e44550ee6..2cedef62519 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -357,17 +357,15 @@ impl EarlyLintPass for UnsafeCode { fn check_item(&mut self, cx: &EarlyContext<'_>, it: &ast::Item) { match it.kind { - ast::ItemKind::Trait(_, ast::Unsafe::Yes(_), ..) => { - self.report_unsafe(cx, it.span, |lint| { + ast::ItemKind::Trait(box ast::TraitKind(_, ast::Unsafe::Yes(_), ..)) => self + .report_unsafe(cx, it.span, |lint| { lint.build("declaration of an `unsafe` trait").emit() - }) - } + }), - ast::ItemKind::Impl { unsafety: ast::Unsafe::Yes(_), .. } => { - self.report_unsafe(cx, it.span, |lint| { + ast::ItemKind::Impl(box ast::ImplKind { unsafety: ast::Unsafe::Yes(_), .. }) => self + .report_unsafe(cx, it.span, |lint| { lint.build("implementation of an `unsafe` trait").emit() - }) - } + }), _ => {} } @@ -872,7 +870,7 @@ declare_lint_pass!( impl EarlyLintPass for AnonymousParameters { fn check_trait_item(&mut self, cx: &EarlyContext<'_>, it: &ast::AssocItem) { - if let ast::AssocItemKind::Fn(_, ref sig, _, _) = it.kind { + if let ast::AssocItemKind::Fn(box FnKind(_, ref sig, _, _)) = it.kind { for arg in sig.decl.inputs.iter() { if let ast::PatKind::Ident(_, ident, None) = arg.pat.kind { if ident.name == kw::Empty { diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index af5972c6c81..26e536e8f1d 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -2,7 +2,7 @@ //! Clippy. use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext}; -use rustc_ast::{Item, ItemKind}; +use rustc_ast::{ImplKind, Item, ItemKind}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::Applicability; use rustc_hir::def::Res; @@ -243,7 +243,7 @@ declare_lint_pass!(LintPassImpl => [LINT_PASS_IMPL_WITHOUT_MACRO]); impl EarlyLintPass for LintPassImpl { fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { - if let ItemKind::Impl { of_trait: Some(lint_pass), .. } = &item.kind { + if let ItemKind::Impl(box ImplKind { of_trait: Some(lint_pass), .. }) = &item.kind { if let Some(last) = lint_pass.path.segments.last() { if last.ident.name == sym::LintPass { let expn_data = lint_pass.path.span.ctxt().outer_expn_data(); diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 2336b52619a..6f44436e2a0 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -30,6 +30,7 @@ #![feature(array_windows)] #![feature(bool_to_option)] #![feature(box_syntax)] +#![feature(box_patterns)] #![feature(crate_visibility_modifier)] #![feature(iter_order_by)] #![feature(never_type)] |
