@@ -78,8 +78,12 @@ fn release_profile_default_to_object() {
78
78
79
79
p. cargo ( "build --release --verbose -Ztrim-paths" )
80
80
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
81
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
82
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
81
+ . with_stderr (
82
+ "\
83
+ [COMPILING] foo v0.0.1 ([CWD])
84
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
85
+ [FINISHED] release [..]" ,
86
+ )
83
87
. run ( ) ;
84
88
}
85
89
@@ -109,8 +113,11 @@ fn one_option() {
109
113
for option in [ "macro" , "diagnostics" , "object" , "all" ] {
110
114
build ( option)
111
115
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
112
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
113
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
116
+ . with_stderr ( & format ! ( "\
117
+ [COMPILING] foo v0.0.1 ([CWD])
118
+ [RUNNING] `rustc [..]-Zremap-path-scope={option} --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
119
+ [FINISHED] dev [..]" ,
120
+ ) )
114
121
. run ( ) ;
115
122
}
116
123
build ( "none" )
@@ -139,8 +146,12 @@ fn multiple_options() {
139
146
140
147
p. cargo ( "build --verbose -Ztrim-paths" )
141
148
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
142
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
143
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
149
+ . with_stderr (
150
+ "\
151
+ [COMPILING] foo v0.0.1 ([CWD])
152
+ [RUNNING] `rustc [..]-Zremap-path-scope=diagnostics,macro,object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
153
+ [FINISHED] dev [..]" ,
154
+ )
144
155
. run ( ) ;
145
156
}
146
157
@@ -163,8 +174,10 @@ fn multiple_options_with_none() {
163
174
164
175
p. cargo ( "build --verbose -Ztrim-paths" )
165
176
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
166
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
167
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
177
+ . with_stderr_line_without (
178
+ & [ "[RUNNING] `rustc [..]" ] ,
179
+ & [ "-Zremap-path-scope" , "--remap-path-prefix" ] ,
180
+ )
168
181
. run ( ) ;
169
182
}
170
183
@@ -193,13 +206,23 @@ fn registry_dependency() {
193
206
. build ( ) ;
194
207
195
208
let registry_src = paths:: home ( ) . join ( ".cargo/registry/src" ) ;
196
- let registry_src = registry_src. display ( ) ;
209
+ let pkg_remap = format ! ( "{}/[..]/bar-0.0.1=bar-0.0.1" , registry_src. display( ) ) ;
197
210
198
211
p. cargo ( "run --verbose -Ztrim-paths" )
199
212
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
200
- . with_stdout ( format ! ( "{registry_src}/[..]/bar-0.0.1/src/lib.rs" ) )
201
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
202
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
213
+ . with_stdout ( "bar-0.0.1/src/lib.rs" )
214
+ . with_stderr (
215
+ & format ! ( "\
216
+ [UPDATING] [..]
217
+ [DOWNLOADING] crates ...
218
+ [DOWNLOADED] bar v0.0.1 ([..])
219
+ [COMPILING] bar v0.0.1
220
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix={pkg_remap} [..]
221
+ [COMPILING] foo v0.0.1 ([CWD])
222
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
223
+ [FINISHED] dev [..]
224
+ [RUNNING] `target/debug/foo[EXE]`" ) ,
225
+ )
203
226
. run ( ) ;
204
227
}
205
228
@@ -233,13 +256,21 @@ fn git_dependency() {
233
256
. build ( ) ;
234
257
235
258
let git_checkouts_src = paths:: home ( ) . join ( ".cargo/git/checkouts" ) ;
236
- let git_checkouts_src = git_checkouts_src. display ( ) ;
259
+ let pkg_remap = format ! ( "{}/bar-[..]/[..]=bar-0.0.1" , git_checkouts_src. display( ) ) ;
237
260
238
261
p. cargo ( "run --verbose -Ztrim-paths" )
239
262
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
240
- . with_stdout ( format ! ( "{git_checkouts_src}/bar-[..]/[..]/src/lib.rs" ) )
241
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
242
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
263
+ . with_stdout ( "bar-0.0.1/src/lib.rs" )
264
+ . with_stderr (
265
+ & format ! ( "\
266
+ [UPDATING] git repository `{url}`
267
+ [COMPILING] bar v0.0.1 ({url}[..])
268
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix={pkg_remap} [..]
269
+ [COMPILING] foo v0.0.1 ([CWD])
270
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
271
+ [FINISHED] dev [..]
272
+ [RUNNING] `target/debug/foo[EXE]`" ) ,
273
+ )
243
274
. run ( ) ;
244
275
}
245
276
@@ -271,8 +302,15 @@ fn path_dependency() {
271
302
p. cargo ( "run --verbose -Ztrim-paths" )
272
303
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
273
304
. with_stdout ( "cocktail-bar/src/lib.rs" )
274
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
275
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
305
+ . with_stderr (
306
+ & format ! ( "\
307
+ [COMPILING] bar v0.0.1 ([..]/cocktail-bar)
308
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
309
+ [COMPILING] foo v0.0.1 ([CWD])
310
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
311
+ [FINISHED] dev [..]
312
+ [RUNNING] `target/debug/foo[EXE]`" ) ,
313
+ )
276
314
. run ( ) ;
277
315
}
278
316
@@ -306,9 +344,16 @@ fn path_dependency_outside_workspace() {
306
344
307
345
p. cargo ( "run --verbose -Ztrim-paths" )
308
346
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
309
- . with_stdout ( format ! ( "{bar_path}/src/lib.rs" ) )
310
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
311
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
347
+ . with_stdout ( "bar-0.0.1/src/lib.rs" )
348
+ . with_stderr (
349
+ & format ! ( "\
350
+ [COMPILING] bar v0.0.1 ([..]/bar)
351
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix={bar_path}=bar-0.0.1 [..]
352
+ [COMPILING] foo v0.0.1 ([CWD])
353
+ [RUNNING] `rustc [..]-Zremap-path-scope=object --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]
354
+ [FINISHED] dev [..]
355
+ [RUNNING] `target/debug/foo[EXE]`" ) ,
356
+ )
312
357
. run ( ) ;
313
358
}
314
359
@@ -337,21 +382,25 @@ fn diagnostics_works() {
337
382
. build ( ) ;
338
383
339
384
let registry_src = paths:: home ( ) . join ( ".cargo/registry/src" ) ;
340
- let registry_src = registry_src. display ( ) ;
385
+ let pkg_remap = format ! ( "{}/[..]/bar-0.0.1=bar-0.0.1" , registry_src. display( ) ) ;
341
386
342
387
p. cargo ( "build -vv -Ztrim-paths" )
343
388
. masquerade_as_nightly_cargo ( & [ "-Ztrim-paths" ] )
344
- . with_stderr_contains ( format ! (
345
- "\
389
+ . with_stderr_contains ( "\
346
390
warning: unused variable: `unused`
347
- --> {registry_src}/[..]/ bar-0.0.1/src/lib.rs:1:18
391
+ --> bar-0.0.1/src/lib.rs:1:18
348
392
|
349
- 1 | pub fn f() {{ let unused = 0; } }
393
+ 1 | pub fn f() { let unused = 0; }
350
394
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
351
395
|
352
396
= note: `#[warn(unused_variables)]` on by default" ,
353
- ) )
354
- . with_stderr_does_not_contain ( "[..]-Zremap-path-scope=[..]" )
355
- . with_stderr_does_not_contain ( "[..]--remap-path-prefix=[..]" )
397
+ )
398
+ . with_stderr_contains (
399
+ & format ! ( "\
400
+ [RUNNING] [..]rustc [..]-Zremap-path-scope=diagnostics --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix={pkg_remap} [..]",
401
+ ) )
402
+ . with_stderr_contains ( "\
403
+ [RUNNING] [..]rustc [..]-Zremap-path-scope=diagnostics --remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] --remap-path-prefix=[CWD]= [..]",
404
+ )
356
405
. run ( ) ;
357
406
}
0 commit comments