Skip to content

Commit 05c927f

Browse files
committed
Only pass -Zincremental-verify-ich for incremental compiles
1 parent 3347209 commit 05c927f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

collector/src/bin/rustc-fake.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,16 @@ fn main() {
8282
// avoid. rustc-perf can accept the higher cost of always verifying hashes,
8383
// and we currently prefer to avoid exposing a means of hard-disabling
8484
// verification.
85-
args.push(OsString::from("-Zincremental-verify-ich"));
85+
//
86+
// Only pass this for incremental compiles. For non-incremental compiles
87+
// the flag only triggers a costly query key verification sweep.
88+
let is_incremental = args.iter().any(|arg| {
89+
arg.to_str()
90+
.is_some_and(|a| a.starts_with("incremental=") || a.starts_with("-Cincremental="))
91+
});
92+
if is_incremental {
93+
args.push(OsString::from("-Zincremental-verify-ich"));
94+
}
8695

8796
if let Some(pos) = args.iter().position(|arg| arg == "--wrap-rustc-with") {
8897
// Strip out the flag and its argument, and run rustc under the wrapper

0 commit comments

Comments
 (0)