Skip to content

Commit

Permalink
fix(trim-paths): merge trim-paths from different profiles
Browse files Browse the repository at this point in the history
In 4d29af1 we forgot to add trim-paths to `fn merge()`.
This commit follows how `-Zprofile-rustflags` works ---
overriding instead of merging array.
  • Loading branch information
weihanglo committed Nov 2, 2023
1 parent 6187019 commit 7535971
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3007,6 +3007,10 @@ impl TomlProfile {
if let Some(v) = &profile.strip {
self.strip = Some(v.clone());
}

if let Some(v) = &profile.trim_paths {
self.trim_paths = Some(v.clone())
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/profile_trim_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fn profile_merge_works() {
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc [..]\
-Zremap-path-scope=macro \
-Zremap-path-scope=diagnostics \
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] \
--remap-path-prefix=[CWD]= [..]
[FINISHED] custom [..]",
Expand Down

0 comments on commit 7535971

Please sign in to comment.