Add tests for declare_lint_pass and impl_lint_pass
This commit is contained in:
parent
753c39672e
commit
ef29db773e
1 changed files with 8 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate rustc;
|
extern crate rustc;
|
||||||
use rustc::lint;
|
use rustc::lint::{LintArray, LintPass};
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate clippy_lints;
|
extern crate clippy_lints;
|
||||||
|
@ -21,8 +21,8 @@ declare_clippy_lint! {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Pass;
|
pub struct Pass;
|
||||||
impl lint::LintPass for Pass {
|
impl LintPass for Pass {
|
||||||
fn get_lints(&self) -> lint::LintArray {
|
fn get_lints(&self) -> LintArray {
|
||||||
lint_array!(TEST_LINT_REGISTERED)
|
lint_array!(TEST_LINT_REGISTERED)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,4 +31,9 @@ impl lint::LintPass for Pass {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare_lint_pass!(Pass2 => [TEST_LINT_REGISTERED]);
|
||||||
|
|
||||||
|
pub struct Pass3;
|
||||||
|
impl_lint_pass!(Pass3 => [TEST_LINT_REGISTERED]);
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue