Skip to content

Commit

Permalink
Rollup merge of rust-lang#59702 - hgallagher1993:origin, r=Centril
Browse files Browse the repository at this point in the history
Use declare_lint_pass! and impl_lint_pass! in more places

Fixes rust-lang#59683
  • Loading branch information
Centril authored Apr 5, 2019
2 parents c392832 + a964921 commit c0ed443
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/librustc/lint/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c0ed443

Please sign in to comment.