Skip to content

Commit 7535971

Browse files
committed
fix(trim-paths): merge trim-paths from different profiles
In 4d29af1 we forgot to add trim-paths to `fn merge()`. This commit follows how `-Zprofile-rustflags` works --- overriding instead of merging array.
1 parent 6187019 commit 7535971

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,10 @@ impl TomlProfile {
30073007
if let Some(v) = &profile.strip {
30083008
self.strip = Some(v.clone());
30093009
}
3010+
3011+
if let Some(v) = &profile.trim_paths {
3012+
self.trim_paths = Some(v.clone())
3013+
}
30103014
}
30113015
}
30123016

tests/testsuite/profile_trim_paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn profile_merge_works() {
192192
"\
193193
[COMPILING] foo v0.0.1 ([CWD])
194194
[RUNNING] `rustc [..]\
195-
-Zremap-path-scope=macro \
195+
-Zremap-path-scope=diagnostics \
196196
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] \
197197
--remap-path-prefix=[CWD]= [..]
198198
[FINISHED] custom [..]",

0 commit comments

Comments
 (0)