Skip to content

Commit 6187019

Browse files
committed
test(trim-paths): profile merge doesn't work
This demonstrate the buggy behavior that profile merge on `trim-paths` doesn't work as expected.
1 parent 23eb492 commit 6187019

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/testsuite/profile_trim_paths.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,41 @@ fn multiple_options() {
165165
.run();
166166
}
167167

168+
#[cargo_test(nightly, reason = "-Zremap-path-scope is unstable")]
169+
fn profile_merge_works() {
170+
let p = project()
171+
.file(
172+
"Cargo.toml",
173+
r#"
174+
[package]
175+
name = "foo"
176+
version = "0.0.1"
177+
178+
[profile.dev]
179+
trim-paths = ["macro"]
180+
181+
[profile.custom]
182+
inherits = "dev"
183+
trim-paths = ["diagnostics"]
184+
"#,
185+
)
186+
.file("src/lib.rs", "")
187+
.build();
188+
189+
p.cargo("build -v -Ztrim-paths --profile custom")
190+
.masquerade_as_nightly_cargo(&["-Ztrim-paths"])
191+
.with_stderr(
192+
"\
193+
[COMPILING] foo v0.0.1 ([CWD])
194+
[RUNNING] `rustc [..]\
195+
-Zremap-path-scope=macro \
196+
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] \
197+
--remap-path-prefix=[CWD]= [..]
198+
[FINISHED] custom [..]",
199+
)
200+
.run();
201+
}
202+
168203
#[cargo_test(nightly, reason = "-Zremap-path-scope is unstable")]
169204
fn registry_dependency() {
170205
Package::new("bar", "0.0.1")

0 commit comments

Comments
 (0)