We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3723cb commit 59c31d3Copy full SHA for 59c31d3
src/lib.rs
@@ -2,6 +2,7 @@
2
#![feature(plugin_registrar)]
3
#![feature(rustc_private)]
4
#![allow(unknown_lints)]
5
+#![feature(borrow_state)]
6
7
extern crate rustc_plugin;
8
use rustc_plugin::Registry;
@@ -12,7 +13,7 @@ pub use clippy_lints::*;
12
13
14
#[plugin_registrar]
15
pub fn plugin_registrar(reg: &mut Registry) {
- if reg.sess.lint_store.borrow().get_lint_groups().iter().any(|&(s, _, _)| s == "clippy") {
16
+ if reg.sess.lint_store.borrow_state() == std::cell::BorrowState::Unused && reg.sess.lint_store.borrow().get_lint_groups().iter().any(|&(s, _, _)| s == "clippy") {
17
reg.sess.struct_warn("running cargo clippy on a crate that also imports the clippy plugin").emit();
18
} else {
19
register_plugins(reg);
0 commit comments