Skip to content

Commit c0ed443

Browse files
authored
Rollup merge of rust-lang#59702 - hgallagher1993:origin, r=Centril
Use declare_lint_pass! and impl_lint_pass! in more places Fixes rust-lang#59683
2 parents c392832 + a964921 commit c0ed443

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/librustc/lint/internal.rs

+2-20
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,7 @@ impl DefaultHashTypes {
2828
}
2929
}
3030

31-
impl LintPass for DefaultHashTypes {
32-
fn get_lints(&self) -> LintArray {
33-
lint_array!(DEFAULT_HASH_TYPES)
34-
}
35-
36-
fn name(&self) -> &'static str {
37-
"DefaultHashTypes"
38-
}
39-
}
31+
impl_lint_pass!(DefaultHashTypes => [DEFAULT_HASH_TYPES]);
4032

4133
impl EarlyLintPass for DefaultHashTypes {
4234
fn check_ident(&mut self, cx: &EarlyContext<'_>, ident: Ident) {
@@ -68,17 +60,7 @@ declare_lint! {
6860
"Usage of `ty::TyKind` outside of the `ty::sty` module"
6961
}
7062

71-
pub struct TyKindUsage;
72-
73-
impl LintPass for TyKindUsage {
74-
fn get_lints(&self) -> LintArray {
75-
lint_array!(USAGE_OF_TY_TYKIND)
76-
}
77-
78-
fn name(&self) -> &'static str {
79-
"TyKindUsage"
80-
}
81-
}
63+
declare_lint_pass!(TyKindUsage => [USAGE_OF_TY_TYKIND]);
8264

8365
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TyKindUsage {
8466
fn check_path(&mut self, cx: &LateContext<'_, '_>, path: &'tcx Path, _: HirId) {

0 commit comments

Comments
 (0)