Skip to content

Commit

Permalink
Add tests for declare_lint_pass and impl_lint_pass
Browse files Browse the repository at this point in the history
  • Loading branch information
kraai committed Apr 17, 2019
1 parent 753c396 commit ef29db7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/ui/lint_without_lint_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#[macro_use]
extern crate rustc;
use rustc::lint;
use rustc::lint::{LintArray, LintPass};

#[macro_use]
extern crate clippy_lints;
Expand All @@ -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)
}

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

0 comments on commit ef29db7

Please sign in to comment.