Skip to content

Commit fb97f06

Browse files
committed
Fix lint_without_lint_pass internal lint
1 parent 4f12b98 commit fb97f06

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
159159
let body = cx.tcx.hir().body_owned_by(
160160
impl_item_refs
161161
.iter()
162-
.find(|iiref| iiref.ident.as_str() == "get_lints")
163-
.expect("LintPass needs to implement get_lints")
162+
.find(|iiref| iiref.ident.as_str() == "lint_vec")
163+
.expect("LintPass needs to implement lint_vec")
164164
.id
165165
.owner_id
166166
.def_id,

tests/ui-internal/lint_without_lint_pass.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern crate rustc_middle;
77
#[macro_use]
88
extern crate rustc_session;
99
extern crate rustc_lint;
10-
use rustc_lint::LintPass;
10+
use rustc_lint::{LintPass, LintVec};
1111

1212
declare_tool_lint! {
1313
pub clippy::TEST_LINT,
@@ -35,6 +35,9 @@ impl LintPass for Pass {
3535
fn name(&self) -> &'static str {
3636
"TEST_LINT"
3737
}
38+
fn get_lints(&self) -> LintVec {
39+
vec![TEST_LINT]
40+
}
3841
}
3942

4043
declare_lint_pass!(Pass2 => [TEST_LINT_REGISTERED]);

0 commit comments

Comments
 (0)