From c3aa69979449af3240de4a73913fce83f88b5e03 Mon Sep 17 00:00:00 2001 From: Federico Poli Date: Thu, 10 Dec 2020 10:26:34 +0100 Subject: [PATCH] Use CARGO_PRIMARY_PACKAGE to skip dependencies See also https://github.com/rust-lang/cargo/pull/8758 and https://github.com/rust-lang/rust-clippy/pull/6188 --- prusti/src/driver.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prusti/src/driver.rs b/prusti/src/driver.rs index a7d5ee1aa27..0a38344e9e9 100644 --- a/prusti/src/driver.rs +++ b/prusti/src/driver.rs @@ -125,8 +125,8 @@ fn main() { // If the environment asks us to actually be rustc, then do that. // If cargo is compiling a dependency, then be rustc. - let prusti_be_rustc = config::be_rustc() - || arg_value(&rustc_args, "--cap-lints", |val| val == "allow").is_some(); + let in_primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok(); + let prusti_be_rustc = config::be_rustc() || !in_primary_package; if prusti_be_rustc { rustc_driver::main(); }