Skip to content

Commit b124892

Browse files
committed
Add test for {impl,declare}_lint_pass macros
1 parent 709ddba commit b124892

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// compile-flags: -Z unstable-options
2+
// check-pass
3+
4+
#![feature(rustc_private)]
5+
6+
extern crate rustc_session;
7+
8+
use rustc_session::lint::{LintArray, LintPass};
9+
use rustc_session::{declare_lint, declare_lint_pass, impl_lint_pass};
10+
11+
declare_lint! {
12+
pub TEST_LINT,
13+
Allow,
14+
"test"
15+
}
16+
17+
struct Foo;
18+
19+
struct Bar<'a>(&'a u32);
20+
21+
impl_lint_pass!(Foo => [TEST_LINT]);
22+
impl_lint_pass!(Bar<'_> => [TEST_LINT]);
23+
24+
declare_lint_pass!(Baz => [TEST_LINT]);
25+
26+
fn main() {}

0 commit comments

Comments
 (0)