rust/tests/ui/lint_without_lint_pass.rs

45 lines
792 B
Rust
Raw Normal View History

2018-10-12 08:09:04 +02:00
#![deny(clippy::internal)]
#![feature(rustc_private)]
#[macro_use]
extern crate rustc;
2019-12-04 00:16:03 +01:00
#[macro_use]
extern crate rustc_session;
2020-01-12 07:08:41 +01:00
extern crate rustc_lint;
use rustc_lint::{LintArray, LintPass};
2018-10-12 08:09:04 +02:00
declare_tool_lint! {
pub clippy::TEST_LINT,
Warn,
"",
report_in_external_macro: true
2018-10-12 08:09:04 +02:00
}
declare_tool_lint! {
pub clippy::TEST_LINT_REGISTERED,
Warn,
"",
report_in_external_macro: true
2018-10-29 20:37:47 +01:00
}
declare_tool_lint! {
pub clippy::TEST_LINT_REGISTERED_ONLY_IMPL,
Warn,
"",
report_in_external_macro: true
2019-10-24 13:54:18 +02:00
}
2018-10-29 20:37:47 +01:00
pub struct Pass;
impl LintPass for Pass {
fn name(&self) -> &'static str {
"TEST_LINT"
}
2018-10-29 20:37:47 +01:00
}
declare_lint_pass!(Pass2 => [TEST_LINT_REGISTERED]);
pub struct Pass3;
2019-10-24 13:54:18 +02:00
impl_lint_pass!(Pass3 => [TEST_LINT_REGISTERED_ONLY_IMPL]);
2018-12-09 23:26:16 +01:00
fn main() {}