Skip to content

Commit 59c31d3

Browse files
committed
plugin mode still needs to work
1 parent e3723cb commit 59c31d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![feature(plugin_registrar)]
33
#![feature(rustc_private)]
44
#![allow(unknown_lints)]
5+
#![feature(borrow_state)]
56

67
extern crate rustc_plugin;
78
use rustc_plugin::Registry;
@@ -12,7 +13,7 @@ pub use clippy_lints::*;
1213

1314
#[plugin_registrar]
1415
pub fn plugin_registrar(reg: &mut Registry) {
15-
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") {
1617
reg.sess.struct_warn("running cargo clippy on a crate that also imports the clippy plugin").emit();
1718
} else {
1819
register_plugins(reg);

0 commit comments

Comments
 (0)