diff --git a/src/lib.rs b/src/lib.rs index f5229d3cb39..cd91b85e59b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,11 @@ pub use clippy_lints::*; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { - register_plugins(reg); + if reg.sess.lint_store.borrow().get_lint_groups().iter().any(|&(s, _, _)| s == "clippy") { + reg.sess.struct_warn("running cargo clippy on a crate that also imports the clippy plugin").emit(); + } else { + register_plugins(reg); + } } // only exists to let the dogfood integration test works.