Skip to content

Commit e3723cb

Browse files
committed
running cargo clippy on a crate that has the clippy plugin enabled errors out due to duplicate lints
1 parent 0dab78b commit e3723cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ pub use clippy_lints::*;
1212

1313
#[plugin_registrar]
1414
pub fn plugin_registrar(reg: &mut Registry) {
15-
register_plugins(reg);
15+
if reg.sess.lint_store.borrow().get_lint_groups().iter().any(|&(s, _, _)| s == "clippy") {
16+
reg.sess.struct_warn("running cargo clippy on a crate that also imports the clippy plugin").emit();
17+
} else {
18+
register_plugins(reg);
19+
}
1620
}
1721

1822
// only exists to let the dogfood integration test works.

0 commit comments

Comments
 (0)