diff --git a/src/cargo/util/toml_mut/manifest.rs b/src/cargo/util/toml_mut/manifest.rs index 7d51f6b5c05..1ac1007d954 100644 --- a/src/cargo/util/toml_mut/manifest.rs +++ b/src/cargo/util/toml_mut/manifest.rs @@ -496,11 +496,6 @@ fn fix_feature_activations( for idx in remove_list.iter().rev() { feature_values.remove(*idx); } - if !remove_list.is_empty() { - // HACK: Instead of cleaning up the users formatting from having removed a feature, we just - // re-format the whole feature list - feature_values.fmt(); - } if status == DependencyStatus::Required { for value in feature_values.iter_mut() { diff --git a/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml b/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml index d961b2bb135..b435e33ebf2 100644 --- a/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml +++ b/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml @@ -17,4 +17,4 @@ toml = "0.1" clippy = "0.4" [features] -std = ["semver/std"] +std = [ "semver/std"] diff --git a/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml b/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml index 63112d33424..f9613bd3092 100644 --- a/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml +++ b/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml @@ -20,4 +20,4 @@ clippy = "0.4" regex = "0.1.1" [features] -std = ["semver/std"] +std = [ "semver/std"] diff --git a/tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml b/tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml index c01931b22eb..c535b19749d 100644 --- a/tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml +++ b/tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml @@ -19,4 +19,16 @@ regex = "0.1.1" serde = "1.0.90" [features] -std = ["dep:clippy", "dep:rustc-serialize", "serde/std", "semver/std"] +std = [ + # Leading clippy + "dep:clippy", # trailing docopt + + # Leading rustc-serialize + "dep:rustc-serialize", # trailing rustc-serialize + + # Leading serde/std + "serde/std", # trailing serde/std + + # Leading semver/std + "semver/std", # trailing toml +]