1 // error-pattern:cargo-clippy
2 #![feature(plugin_registrar)]
3 #![feature(rustc_private)]
4 #![warn(rust_2018_idioms)]
6 // FIXME: switch to something more ergonomic here, once available.
7 // (Currently there is no way to opt into sysroot crates without `extern crate`.)
8 #[allow(unused_extern_crates)]
9 extern crate rustc_driver;
10 #[allow(unused_extern_crates)]
11 extern crate rustc_plugin;
12 use self::rustc_plugin::Registry;
15 pub fn plugin_registrar(reg: &mut Registry<'_>) {
16 reg.sess.lint_store.with_read_lock(|lint_store| {
17 for (lint, _, _) in lint_store.get_lint_groups() {
20 "the clippy plugin is being deprecated, please use cargo clippy or rls with the clippy feature",
24 // cargo clippy run on a crate that also uses the plugin
30 let conf = clippy_lints::read_conf(reg);
31 clippy_lints::register_plugins(reg, &conf);
34 // only exists to let the dogfood integration test works.
35 // Don't run clippy as an executable directly
38 panic!("Please use the cargo-clippy executable");