1
Fork 0
This commit is contained in:
Oliver Schneider 2016-08-17 18:35:25 +02:00
parent 59c31d319a
commit 7b717d3152
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46
6 changed files with 12 additions and 18 deletions

View file

@ -9,20 +9,18 @@ use rustc_plugin::Registry;
extern crate clippy_lints;
pub use clippy_lints::*;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
if reg.sess.lint_store.borrow_state() == std::cell::BorrowState::Unused && 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);
clippy_lints::register_plugins(reg);
}
}
// only exists to let the dogfood integration test works.
// Don't run clippy as an executable directly
#[allow(dead_code, print_stdout)]
#[allow(dead_code)]
fn main() {
panic!("Please use the cargo-clippy executable");
}