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
1 changed files with 8 additions and 3 deletions

View File

@ -3,7 +3,7 @@
#[macro_use]
extern crate rustc;
use rustc::lint;
use rustc::lint::{LintArray, LintPass};
#[macro_use]
extern crate clippy_lints;
@ -21,8 +21,8 @@ declare_clippy_lint! {
}
pub struct Pass;
impl lint::LintPass for Pass {
fn get_lints(&self) -> lint::LintArray {
impl LintPass for Pass {
fn get_lints(&self) -> LintArray {
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() {}