-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathlib.rs
36 lines (32 loc) · 1.04 KB
/
lib.rs
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
// error-pattern:cargo-clippy
#![feature(plugin_registrar)]
#![feature(rust_2018_preview)]
#![feature(rustc_private)]
#![feature(macro_vis_matcher)]
#![allow(unknown_lints)]
#![allow(missing_docs_in_private_items)]
#![warn(rust_2018_idioms)]
use rustc_plugin::Registry;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
reg.sess.lint_store.with_read_lock(|lint_store| {
for (lint, _, _) in lint_store.get_lint_groups() {
reg.sess
.struct_warn(
"the clippy plugin is being deprecated, please use cargo clippy or rls with the clippy feature",
)
.emit();
if lint == "clippy" {
// cargo clippy run on a crate that also uses the plugin
return;
}
}
});
clippy_lints::register_plugins(reg);
}
// only exists to let the dogfood integration test works.
// Don't run clippy as an executable directly
#[allow(dead_code)]
fn main() {
panic!("Please use the cargo-clippy executable");
}