1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
10 // error-pattern:cargo-clippy
11 #![feature(plugin_registrar)]
12 #![feature(rustc_private)]
13 #![allow(clippy::missing_docs_in_private_items)]
14 #![warn(rust_2018_idioms)]
16 // FIXME: switch to something more ergonomic here, once available.
17 // (currently there is no way to opt into sysroot crates w/o `extern crate`)
18 #[allow(unused_extern_crates)]
19 extern crate rustc_plugin;
20 use self::rustc_plugin::Registry;
23 pub fn plugin_registrar(reg: &mut Registry<'_>) {
24 reg.sess.lint_store.with_read_lock(|lint_store| {
25 for (lint, _, _) in lint_store.get_lint_groups() {
28 "the clippy plugin is being deprecated, please use cargo clippy or rls with the clippy feature",
32 // cargo clippy run on a crate that also uses the plugin
38 let conf = clippy_lints::read_conf(reg);
39 clippy_lints::register_plugins(reg, &conf);
42 // only exists to let the dogfood integration test works.
43 // Don't run clippy as an executable directly
46 panic!("Please use the cargo-clippy executable");