about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-05 12:46:52 +0200
committerGitHub <noreply@github.com>2019-04-05 12:46:52 +0200
commitc0ed443fdd8c4d01abbba5970bd48c76cd0c0707 (patch)
tree56c146f3c183c6eb28c1e866952456e1cb85d69a
parentc392832195ec9e900fe38cb76de7bf1e8e98df46 (diff)
parenta96492112c413f0846245eb2c579bed1da251549 (diff)
downloadrust-c0ed443fdd8c4d01abbba5970bd48c76cd0c0707.tar.gz
rust-c0ed443fdd8c4d01abbba5970bd48c76cd0c0707.zip
Rollup merge of #59702 - hgallagher1993:origin, r=Centril
Use declare_lint_pass! and impl_lint_pass! in more places

Fixes #59683
-rw-r--r--src/librustc/lint/internal.rs22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/librustc/lint/internal.rs b/src/librustc/lint/internal.rs
index d5f8876d162..030a9c1f935 100644
--- a/src/librustc/lint/internal.rs
+++ b/src/librustc/lint/internal.rs
@@ -28,15 +28,7 @@ impl DefaultHashTypes {
     }
 }
 
-impl LintPass for DefaultHashTypes {
-    fn get_lints(&self) -> LintArray {
-        lint_array!(DEFAULT_HASH_TYPES)
-    }
-
-    fn name(&self) -> &'static str {
-        "DefaultHashTypes"
-    }
-}
+impl_lint_pass!(DefaultHashTypes => [DEFAULT_HASH_TYPES]);
 
 impl EarlyLintPass for DefaultHashTypes {
     fn check_ident(&mut self, cx: &EarlyContext<'_>, ident: Ident) {
@@ -68,17 +60,7 @@ declare_lint! {
     "Usage of `ty::TyKind` outside of the `ty::sty` module"
 }
 
-pub struct TyKindUsage;
-
-impl LintPass for TyKindUsage {
-    fn get_lints(&self) -> LintArray {
-        lint_array!(USAGE_OF_TY_TYKIND)
-    }
-
-    fn name(&self) -> &'static str {
-        "TyKindUsage"
-    }
-}
+declare_lint_pass!(TyKindUsage => [USAGE_OF_TY_TYKIND]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TyKindUsage {
     fn check_path(&mut self, cx: &LateContext<'_, '_>, path: &'tcx Path, _: HirId) {