]> git.lizzy.rs Git - rust.git/commitdiff
Add tests for declare_lint_pass and impl_lint_pass
authorMatthew Kraai <kraai@ftbfs.org>
Tue, 16 Apr 2019 22:21:12 +0000 (15:21 -0700)
committerMatthew Kraai <kraai@ftbfs.org>
Wed, 17 Apr 2019 16:35:23 +0000 (09:35 -0700)
tests/ui/lint_without_lint_pass.rs

index a6f10a006dbd3a7ccecf0d33a940f8aa6e999cde..81b639848915a3d74fd6ff519051a5a3cb02eaf6 100644 (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 @@
 }
 
 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 @@ fn name(&self) -> &'static str {
     }
 }
 
+declare_lint_pass!(Pass2 => [TEST_LINT_REGISTERED]);
+
+pub struct Pass3;
+impl_lint_pass!(Pass3 => [TEST_LINT_REGISTERED]);
+
 fn main() {}