Skip to content

Commit 1cdf37a

Browse files
committed
refactor: use Path::push to construct remap-path-prefix
It creates paths with correct separators for different systems.
1 parent 2560340 commit 1cdf37a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cargo/core/compiler/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,11 @@ fn sysroot_remap(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> OsString {
13131313
let sysroot = &build_runner.bcx.target_data.info(unit.kind).sysroot;
13141314
let mut remap = OsString::from("--remap-path-prefix=");
13151315
remap.push(sysroot);
1316-
remap.push("/lib/rustlib/src/rust"); // See also `detect_sysroot_src_path()`.
1316+
// See also `detect_sysroot_src_path()`
1317+
remap.push("lib");
1318+
remap.push("rustlib");
1319+
remap.push("src");
1320+
remap.push("rust");
13171321
remap.push("=");
13181322
remap.push("/rustc/");
13191323
if let Some(commit_hash) = build_runner.bcx.rustc().commit_hash.as_ref() {

0 commit comments

Comments
 (0)