Skip to content

Commit 767b3d6

Browse files
committed
fix(remove): Leave formatting to the user
Fixes #11743
1 parent a96bc9f commit 767b3d6

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

src/cargo/util/toml_mut/manifest.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,6 @@ fn fix_feature_activations(
496496
for idx in remove_list.iter().rev() {
497497
feature_values.remove(*idx);
498498
}
499-
if !remove_list.is_empty() {
500-
// HACK: Instead of cleaning up the users formatting from having removed a feature, we just
501-
// re-format the whole feature list
502-
feature_values.fmt();
503-
}
504499

505500
if status == DependencyStatus::Required {
506501
for value in feature_values.iter_mut() {

tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ toml = "0.1"
1717
clippy = "0.4"
1818

1919
[features]
20-
std = ["semver/std"]
20+
std = [ "semver/std"]

tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ clippy = "0.4"
2020
regex = "0.1.1"
2121

2222
[features]
23-
std = ["semver/std"]
23+
std = [ "semver/std"]

tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,16 @@ regex = "0.1.1"
1919
serde = "1.0.90"
2020

2121
[features]
22-
std = ["dep:clippy", "dep:rustc-serialize", "serde/std", "semver/std"]
22+
std = [
23+
# Leading clippy
24+
"dep:clippy", # trailing docopt
25+
26+
# Leading rustc-serialize
27+
"dep:rustc-serialize", # trailing rustc-serialize
28+
29+
# Leading serde/std
30+
"serde/std", # trailing serde/std
31+
32+
# Leading semver/std
33+
"semver/std", # trailing toml
34+
]

0 commit comments

Comments
 (0)