diff options
| author | Ralf Jung <post@ralfj.de> | 2024-11-26 06:44:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-26 06:44:59 +0000 |
| commit | 24a1946305a2a21e5f2e2e54e71186265ee60720 (patch) | |
| tree | 78e99aae893c0498795c899f6ffc0c0ead824c32 | |
| parent | 366001f392fc06a4901913b7c0b8b30dd410fe8f (diff) | |
| parent | a05e53b68956f3b183d52e0ba4a46e0fce929a61 (diff) | |
| download | rust-24a1946305a2a21e5f2e2e54e71186265ee60720.tar.gz rust-24a1946305a2a21e5f2e2e54e71186265ee60720.zip | |
Merge pull request #4061 from asquared31415/dep_info_fix
Use `PathBuf` APIs to correctly do some path manipulation cross-platform
| -rw-r--r-- | src/tools/miri/cargo-miri/src/phases.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tools/miri/cargo-miri/src/phases.rs b/src/tools/miri/cargo-miri/src/phases.rs index f1f76fd338c..7ca4f414c20 100644 --- a/src/tools/miri/cargo-miri/src/phases.rs +++ b/src/tools/miri/cargo-miri/src/phases.rs @@ -348,14 +348,17 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) { // Create a stub .d file to stop Cargo from "rebuilding" the crate: // https://github.com/rust-lang/miri/issues/1724#issuecomment-787115693 // As we store a JSON file instead of building the crate here, an empty file is fine. - let dep_info_name = format!( - "{}/{}{}.d", - get_arg_flag_value("--out-dir").unwrap(), + let mut dep_info_name = PathBuf::from(get_arg_flag_value("--out-dir").unwrap()); + dep_info_name.push(format!( + "{}{}.d", get_arg_flag_value("--crate-name").unwrap(), get_arg_flag_value("extra-filename").unwrap_or_default(), - ); + )); if verbose > 0 { - eprintln!("[cargo-miri rustc] writing stub dep-info to `{dep_info_name}`"); + eprintln!( + "[cargo-miri rustc] writing stub dep-info to `{}`", + dep_info_name.display() + ); } File::create(dep_info_name).expect("failed to create fake .d file"); } |
