diff options
| author | Dániel Buga <bugadani@gmail.com> | 2021-01-29 08:31:08 +0100 |
|---|---|---|
| committer | Dániel Buga <bugadani@gmail.com> | 2021-02-01 09:23:39 +0100 |
| commit | b87e1ecdf05d4fb2d14f13d760bb37098c58b06e (patch) | |
| tree | 366f3510245bdb4f2783398babd5da30fac59d89 /compiler/rustc_lint/src/builtin.rs | |
| parent | fee0d31397c5ac46d08867e903131d1d73825a9e (diff) | |
| download | rust-b87e1ecdf05d4fb2d14f13d760bb37098c58b06e.tar.gz rust-b87e1ecdf05d4fb2d14f13d760bb37098c58b06e.zip | |
Box the biggest ast::ItemKind variants
Diffstat (limited to 'compiler/rustc_lint/src/builtin.rs')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 16 |
1 files changed, 7 insertions, 9 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 { |
