Skip to content

Commit c3aa699

Browse files
committed
Use CARGO_PRIMARY_PACKAGE to skip dependencies
See also rust-lang/cargo#8758 and rust-lang/rust-clippy#6188
1 parent ee5def9 commit c3aa699

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prusti/src/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ fn main() {
125125

126126
// If the environment asks us to actually be rustc, then do that.
127127
// If cargo is compiling a dependency, then be rustc.
128-
let prusti_be_rustc = config::be_rustc()
129-
|| arg_value(&rustc_args, "--cap-lints", |val| val == "allow").is_some();
128+
let in_primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok();
129+
let prusti_be_rustc = config::be_rustc() || !in_primary_package;
130130
if prusti_be_rustc {
131131
rustc_driver::main();
132132
}

0 commit comments

Comments
 (0)