1
Fork 0

Add tests for declare_lint_pass and impl_lint_pass

This commit is contained in:
Matthew Kraai 2019-04-16 15:21:12 -07:00
parent 753c39672e
commit ef29db773e

View file

@ -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() {}