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