Skip to content

Commit 28b169b

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 decd020 commit 28b169b

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
@@ -496,6 +496,9 @@ features! {
496496

497497
// Support for 2024 edition.
498498
(unstable, edition2024, "", "reference/unstable.html#edition-2024"),
499+
500+
// Allow setting trim-paths in a profile to control the sanitisation of file paths in build outputs.
501+
(unstable, trim_paths, "", "reference/unstable.html#profile-trim-paths-option"),
499502
}
500503

501504
pub struct Feature {
@@ -755,6 +758,7 @@ unstable_cli_options!(
755758
separate_nightlies: bool = (HIDDEN),
756759
skip_rustdoc_fingerprint: bool = (HIDDEN),
757760
target_applies_to_host: bool = ("Enable the `target-applies-to-host` key in the .cargo/config.toml file"),
761+
trim_paths: bool = ("Enable the `trim-paths` option in profiles"),
758762
unstable_options: bool = ("Allow the usage of unstable options"),
759763
);
760764

@@ -1089,6 +1093,7 @@ impl CliUnstable {
10891093
"no-index-update" => self.no_index_update = parse_empty(k, v)?,
10901094
"panic-abort-tests" => self.panic_abort_tests = parse_empty(k, v)?,
10911095
"profile-rustflags" => self.profile_rustflags = parse_empty(k, v)?,
1096+
"trim-paths" => self.trim_paths = parse_empty(k, v)?,
10921097
"publish-timeout" => self.publish_timeout = parse_empty(k, v)?,
10931098
"rustdoc-map" => self.rustdoc_map = parse_empty(k, v)?,
10941099
"rustdoc-scrape-examples" => self.rustdoc_scrape_examples = parse_empty(k, v)?,

0 commit comments

Comments
 (0)