]> git.proxmox.com Git - rustc.git/blame - src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs
New upstream version 1.40.0+dfsg1
[rustc.git] / src / test / ui-fulldeps / internal-lints / lint_pass_impl_without_macro.rs
CommitLineData
416331ca
XL
1// compile-flags: -Z unstable-options
2
3#![feature(rustc_private)]
4#![deny(rustc::lint_pass_impl_without_macro)]
5
6extern crate rustc;
7
8use rustc::lint::{LintArray, LintPass};
e74abb32 9use rustc::{declare_lint, declare_lint_pass, impl_lint_pass};
416331ca
XL
10
11declare_lint! {
12 pub TEST_LINT,
13 Allow,
14 "test"
15}
16
17struct Foo;
18
19impl LintPass for Foo { //~ERROR implementing `LintPass` by hand
416331ca
XL
20 fn name(&self) -> &'static str {
21 "Foo"
22 }
23}
24
25macro_rules! custom_lint_pass_macro {
26 () => {
27 struct Custom;
28
29 impl LintPass for Custom { //~ERROR implementing `LintPass` by hand
416331ca
XL
30 fn name(&self) -> &'static str {
31 "Custom"
32 }
33 }
34 };
35}
36
37custom_lint_pass_macro!();
38
39struct Bar;
40
41impl_lint_pass!(Bar => [TEST_LINT]);
42
43declare_lint_pass!(Baz => [TEST_LINT]);
44
45fn main() {}