]> git.lizzy.rs Git - rust.git/blob - src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs
Auto merge of #66520 - alexcrichton:disable-gdb-wasm, r=eddyb
[rust.git] / src / test / ui-fulldeps / internal-lints / lint_pass_impl_without_macro.rs
1 // compile-flags: -Z unstable-options
2
3 #![feature(rustc_private)]
4 #![deny(rustc::lint_pass_impl_without_macro)]
5
6 extern crate rustc;
7 extern crate rustc_session;
8
9 use rustc::lint::{LintArray, LintPass};
10 use rustc::{declare_lint_pass, impl_lint_pass};
11 use rustc_session::declare_lint;
12
13 declare_lint! {
14     pub TEST_LINT,
15     Allow,
16     "test"
17 }
18
19 struct Foo;
20
21 impl LintPass for Foo { //~ERROR implementing `LintPass` by hand
22     fn name(&self) -> &'static str {
23         "Foo"
24     }
25 }
26
27 macro_rules! custom_lint_pass_macro {
28     () => {
29         struct Custom;
30
31         impl LintPass for Custom { //~ERROR implementing `LintPass` by hand
32             fn name(&self) -> &'static str {
33                 "Custom"
34             }
35         }
36     };
37 }
38
39 custom_lint_pass_macro!();
40
41 struct Bar;
42
43 impl_lint_pass!(Bar => [TEST_LINT]);
44
45 declare_lint_pass!(Baz => [TEST_LINT]);
46
47 fn main() {}