running cargo clippy on a crate that has the clippy plugin enabled errors out due to duplicate lints

This commit is contained in:
Oliver Schneider 2016-08-17 17:43:49 +02:00
parent 0dab78b3e6
commit e3723cb938
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46

View file

@ -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.