Skip to content

Commit ef29db7

Browse files
committed
Add tests for declare_lint_pass and impl_lint_pass
1 parent 753c396 commit ef29db7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/ui/lint_without_lint_pass.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#[macro_use]
55
extern crate rustc;
6-
use rustc::lint;
6+
use rustc::lint::{LintArray, LintPass};
77

88
#[macro_use]
99
extern crate clippy_lints;
@@ -21,8 +21,8 @@ declare_clippy_lint! {
2121
}
2222

2323
pub struct Pass;
24-
impl lint::LintPass for Pass {
25-
fn get_lints(&self) -> lint::LintArray {
24+
impl LintPass for Pass {
25+
fn get_lints(&self) -> LintArray {
2626
lint_array!(TEST_LINT_REGISTERED)
2727
}
2828

@@ -31,4 +31,9 @@ impl lint::LintPass for Pass {
3131
}
3232
}
3333

34+
declare_lint_pass!(Pass2 => [TEST_LINT_REGISTERED]);
35+
36+
pub struct Pass3;
37+
impl_lint_pass!(Pass3 => [TEST_LINT_REGISTERED]);
38+
3439
fn main() {}

0 commit comments

Comments
 (0)