Skip to content

Commit 6e748f8

Browse files
committed
feat(trim-paths): add unstable feature gate
This implements RFC-3127[^1] on Cargo side. [^1]: https://rust-lang.github.io/rfcs/3127-trim-paths.html
1 parent 2d60a86 commit 6e748f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cargo/core/features.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ features! {
483483

484484
// Allow specifying rustflags directly in a profile
485485
(stable, workspace_inheritance, "1.64", "reference/unstable.html#workspace-inheritance"),
486+
487+
// Allow setting trim-paths in a profile to control the sanitisation of file paths in build outputs.
488+
(unstable, trim_paths, "", "reference/unstable.html#profile-trim-paths-option"),
486489
}
487490

488491
pub struct Feature {
@@ -752,6 +755,7 @@ unstable_cli_options!(
752755
separate_nightlies: bool = (HIDDEN),
753756
skip_rustdoc_fingerprint: bool = (HIDDEN),
754757
target_applies_to_host: bool = ("Enable the `target-applies-to-host` key in the .cargo/config.toml file"),
758+
trim_paths: bool = ("Enable the `trim-paths` option in profiles"),
755759
unstable_options: bool = ("Allow the usage of unstable options"),
756760
);
757761

@@ -1121,6 +1125,7 @@ impl CliUnstable {
11211125
"no-index-update" => self.no_index_update = parse_empty(k, v)?,
11221126
"panic-abort-tests" => self.panic_abort_tests = parse_empty(k, v)?,
11231127
"profile-rustflags" => self.profile_rustflags = parse_empty(k, v)?,
1128+
"trim-paths" => self.trim_paths = parse_empty(k, v)?,
11241129
"publish-timeout" => self.publish_timeout = parse_empty(k, v)?,
11251130
"registry-auth" => self.registry_auth = parse_empty(k, v)?,
11261131
"rustdoc-map" => self.rustdoc_map = parse_empty(k, v)?,

0 commit comments

Comments
 (0)