Skip to content

Commit 94b6aaf

Browse files
committed
Auto merge of rust-lang#2476 - RalfJung:target-dir, r=RalfJung
clarifying comments for target-dir handling I thought we could simplify this logic, but alas, `cargo metadata --target-dir` is not a thing (even though the effective target-dir *does* affect the metadata).
2 parents 5b22aa7 + 0f1ce43 commit 94b6aaf

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

cargo-miri/src/phases.rs

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
133133
}
134134
}
135135
// Detect the target directory if it's not specified via `--target-dir`.
136+
// (`cargo metadata` does not support `--target-dir`, that's why we have to handle this ourselves.)
136137
let target_dir = target_dir.get_or_insert_with(|| metadata.target_directory.clone());
137138
// Set `--target-dir` to `miri` inside the original target directory.
138139
target_dir.push("miri");

cargo-miri/src/util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ fn cargo_extra_flags() -> Vec<String> {
237237
flags.push(manifest);
238238
}
239239

240+
// Forwarding `--target-dir` would make sense, but `cargo metadata` does not support that flag.
241+
240242
flags
241243
}
242244

0 commit comments

Comments
 (0)