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(); }