blob: 6b649132aca3198d7f5b0d32ff61dbc6a875c3a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#![deny(clippy::lint_without_lint_pass)]
#![allow(clippy::missing_clippy_version_attribute)]
#![feature(rustc_private)]
#[macro_use]
extern crate rustc_middle;
#[macro_use]
extern crate rustc_session;
extern crate rustc_lint;
use rustc_lint::{LintPass, LintVec};
declare_tool_lint! {
//~^ lint_without_lint_pass
pub clippy::TEST_LINT,
Warn,
"",
report_in_external_macro: true
}
declare_tool_lint! {
pub clippy::TEST_LINT_REGISTERED,
Warn,
"",
report_in_external_macro: true
}
declare_tool_lint! {
pub clippy::TEST_LINT_REGISTERED_ONLY_IMPL,
Warn,
"",
report_in_external_macro: true
}
pub struct Pass;
impl LintPass for Pass {
fn name(&self) -> &'static str {
"TEST_LINT"
}
fn get_lints(&self) -> LintVec {
vec![TEST_LINT]
}
}
declare_lint_pass!(Pass2 => [TEST_LINT_REGISTERED]);
pub struct Pass3;
impl_lint_pass!(Pass3 => [TEST_LINT_REGISTERED_ONLY_IMPL]);
fn main() {}
|