@@ -225,11 +225,11 @@ fn registry_dependency() {
225
225
. build ( ) ;
226
226
227
227
let registry_src = paths:: home ( ) . join ( ".cargo/registry/src" ) ;
228
- let pkg_remap = format ! ( "{}/[..]/bar-0.0.1=bar-0.0.1" , registry_src. display( ) ) ;
228
+ let registry_src = registry_src. display ( ) ;
229
229
230
230
p. cargo ( "run --verbose -Ztrim-paths" )
231
231
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
232
- . with_stdout ( "bar-0.0.1/src/lib.rs" )
232
+ . with_stdout ( "-[..]/ bar-0.0.1/src/lib.rs" ) // Omit the hash of Source URL
233
233
. with_stderr ( & format ! (
234
234
"\
235
235
[UPDATING] [..]
@@ -238,7 +238,7 @@ fn registry_dependency() {
238
238
[COMPILING] bar v0.0.1
239
239
[RUNNING] `rustc [..]\
240
240
-Zremap-path-scope=object \
241
- --remap-path-prefix={pkg_remap} \
241
+ --remap-path-prefix={registry_src}= \
242
242
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..]
243
243
[COMPILING] foo v0.0.1 ([CWD])
244
244
[RUNNING] `rustc [..]\
@@ -281,18 +281,18 @@ fn git_dependency() {
281
281
. build ( ) ;
282
282
283
283
let git_checkouts_src = paths:: home ( ) . join ( ".cargo/git/checkouts" ) ;
284
- let pkg_remap = format ! ( "{}/bar-[..]/[..]=bar-0.0.1" , git_checkouts_src. display( ) ) ;
284
+ let git_checkouts_src = git_checkouts_src. display ( ) ;
285
285
286
286
p. cargo ( "run --verbose -Ztrim-paths" )
287
287
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
288
- . with_stdout ( "bar-0.0.1/ src/lib.rs" )
288
+ . with_stdout ( "bar-[..]/[..]/ src/lib.rs" ) // Omit the hash of Source URL and commit
289
289
. with_stderr ( & format ! (
290
290
"\
291
291
[UPDATING] git repository `{url}`
292
292
[COMPILING] bar v0.0.1 ({url}[..])
293
293
[RUNNING] `rustc [..]\
294
294
-Zremap-path-scope=object \
295
- --remap-path-prefix={pkg_remap} \
295
+ --remap-path-prefix={git_checkouts_src}= \
296
296
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..]
297
297
[COMPILING] foo v0.0.1 ([CWD])
298
298
[RUNNING] `rustc [..]\
@@ -426,7 +426,6 @@ fn diagnostics_works() {
426
426
427
427
let registry_src = paths:: home ( ) . join ( ".cargo/registry/src" ) ;
428
428
let registry_src = registry_src. display ( ) ;
429
- let pkg_remap = format ! ( "{registry_src}/[..]/bar-0.0.1=bar-0.0.1" ) ;
430
429
431
430
p. cargo ( "build -vv -Ztrim-paths" )
432
431
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
@@ -439,7 +438,7 @@ fn diagnostics_works() {
439
438
"\
440
439
[RUNNING] [..]rustc [..]\
441
440
-Zremap-path-scope=diagnostics \
442
- --remap-path-prefix={pkg_remap} \
441
+ --remap-path-prefix={registry_src}= \
443
442
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..]",
444
443
) )
445
444
. with_stderr_contains (
@@ -516,9 +515,9 @@ fn object_works_helper(split_debuginfo: &str, run: impl Fn(&std::path::Path) ->
516
515
use std:: os:: unix:: ffi:: OsStrExt ;
517
516
518
517
let registry_src = paths:: home ( ) . join ( ".cargo/registry/src" ) ;
519
- let pkg_remap = format ! ( "{}/[..]/bar-0.0.1=bar-0.0.1" , registry_src. display( ) ) ;
520
- let rust_src = "/lib/rustc/src/rust" . as_bytes ( ) ;
521
518
let registry_src_bytes = registry_src. as_os_str ( ) . as_bytes ( ) ;
519
+ let registry_src = registry_src. display ( ) ;
520
+ let rust_src = "/lib/rustc/src/rust" . as_bytes ( ) ;
522
521
523
522
Package :: new ( "bar" , "0.0.1" )
524
523
. file ( "Cargo.toml" , & basic_manifest ( "bar" , "0.0.1" ) )
@@ -570,7 +569,7 @@ fn object_works_helper(split_debuginfo: &str, run: impl Fn(&std::path::Path) ->
570
569
[COMPILING] bar v0.0.1
571
570
[RUNNING] `rustc [..]-C split-debuginfo={split_debuginfo} [..]\
572
571
-Zremap-path-scope=object \
573
- --remap-path-prefix={pkg_remap} \
572
+ --remap-path-prefix={registry_src}= \
574
573
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..]
575
574
[COMPILING] foo v0.0.1 ([CWD])
576
575
[RUNNING] `rustc [..]-C split-debuginfo={split_debuginfo} [..]\
0 commit comments