mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 08:30:45 +00:00
plugin mode still needs to work
This commit is contained in:
parent
e3723cb938
commit
59c31d319a
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
#![feature(plugin_registrar)]
|
#![feature(plugin_registrar)]
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
#![allow(unknown_lints)]
|
#![allow(unknown_lints)]
|
||||||
|
#![feature(borrow_state)]
|
||||||
|
|
||||||
extern crate rustc_plugin;
|
extern crate rustc_plugin;
|
||||||
use rustc_plugin::Registry;
|
use rustc_plugin::Registry;
|
||||||
|
@ -12,7 +13,7 @@ pub use clippy_lints::*;
|
||||||
|
|
||||||
#[plugin_registrar]
|
#[plugin_registrar]
|
||||||
pub fn plugin_registrar(reg: &mut Registry) {
|
pub fn plugin_registrar(reg: &mut Registry) {
|
||||||
if reg.sess.lint_store.borrow().get_lint_groups().iter().any(|&(s, _, _)| s == "clippy") {
|
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();
|
reg.sess.struct_warn("running cargo clippy on a crate that also imports the clippy plugin").emit();
|
||||||
} else {
|
} else {
|
||||||
register_plugins(reg);
|
register_plugins(reg);
|
||||||
|
|
Loading…
Reference in a new issue