Skip to content

Commit

Permalink
Merge pull request #1129 from rust-lang/edition-2024
Browse files Browse the repository at this point in the history
No longer set the Cargo feature for edition 2024
  • Loading branch information
shepmaster authored Dec 5, 2024
2 parents 647eaae + eb30c6f commit b352356
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
16 changes: 0 additions & 16 deletions compiler/base/modify-cargo-toml/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ fn ensure_string_in_vec(values: &mut Vec<String>, val: &str) {
}
}

pub fn set_feature_edition2024(cargo_toml: Value) -> Value {
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
struct CargoToml {
#[serde(default)]
cargo_features: Vec<String>,
#[serde(flatten)]
other: Other,
}

modify(cargo_toml, |mut cargo_toml: CargoToml| {
ensure_string_in_vec(&mut cargo_toml.cargo_features, "edition2024");
cargo_toml
})
}

pub fn set_edition(cargo_toml: Value, edition: &str) -> Value {
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
Expand Down
24 changes: 0 additions & 24 deletions compiler/base/orchestrator/src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@ impl LowerRequest for ExecuteRequest {

impl CargoTomlModifier for ExecuteRequest {
fn modify_cargo_toml(&self, mut cargo_toml: toml::Value) -> toml::Value {
if self.edition == Edition::Rust2024 {
cargo_toml = modify_cargo_toml::set_feature_edition2024(cargo_toml);
}

cargo_toml = modify_cargo_toml::set_edition(cargo_toml, self.edition.to_cargo_toml_key());

if let Some(crate_type) = self.crate_type.to_library_cargo_toml_key() {
Expand Down Expand Up @@ -534,10 +530,6 @@ impl LowerRequest for CompileRequest {

impl CargoTomlModifier for CompileRequest {
fn modify_cargo_toml(&self, mut cargo_toml: toml::Value) -> toml::Value {
if self.edition == Edition::Rust2024 {
cargo_toml = modify_cargo_toml::set_feature_edition2024(cargo_toml);
}

cargo_toml = modify_cargo_toml::set_edition(cargo_toml, self.edition.to_cargo_toml_key());

if let Some(crate_type) = self.crate_type.to_library_cargo_toml_key() {
Expand Down Expand Up @@ -597,10 +589,6 @@ impl LowerRequest for FormatRequest {

impl CargoTomlModifier for FormatRequest {
fn modify_cargo_toml(&self, mut cargo_toml: toml::Value) -> toml::Value {
if self.edition == Edition::Rust2024 {
cargo_toml = modify_cargo_toml::set_feature_edition2024(cargo_toml);
}

cargo_toml = modify_cargo_toml::set_edition(cargo_toml, self.edition.to_cargo_toml_key());

if let Some(crate_type) = self.crate_type.to_library_cargo_toml_key() {
Expand Down Expand Up @@ -646,10 +634,6 @@ impl LowerRequest for ClippyRequest {

impl CargoTomlModifier for ClippyRequest {
fn modify_cargo_toml(&self, mut cargo_toml: toml::Value) -> toml::Value {
if self.edition == Edition::Rust2024 {
cargo_toml = modify_cargo_toml::set_feature_edition2024(cargo_toml);
}

cargo_toml = modify_cargo_toml::set_edition(cargo_toml, self.edition.to_cargo_toml_key());

if let Some(crate_type) = self.crate_type.to_library_cargo_toml_key() {
Expand Down Expand Up @@ -694,10 +678,6 @@ impl LowerRequest for MiriRequest {

impl CargoTomlModifier for MiriRequest {
fn modify_cargo_toml(&self, mut cargo_toml: toml::Value) -> toml::Value {
if self.edition == Edition::Rust2024 {
cargo_toml = modify_cargo_toml::set_feature_edition2024(cargo_toml);
}

cargo_toml = modify_cargo_toml::set_edition(cargo_toml, self.edition.to_cargo_toml_key());

if let Some(crate_type) = self.crate_type.to_library_cargo_toml_key() {
Expand Down Expand Up @@ -744,10 +724,6 @@ impl LowerRequest for MacroExpansionRequest {

impl CargoTomlModifier for MacroExpansionRequest {
fn modify_cargo_toml(&self, mut cargo_toml: toml::Value) -> toml::Value {
if self.edition == Edition::Rust2024 {
cargo_toml = modify_cargo_toml::set_feature_edition2024(cargo_toml);
}

cargo_toml = modify_cargo_toml::set_edition(cargo_toml, self.edition.to_cargo_toml_key());

if let Some(crate_type) = self.crate_type.to_library_cargo_toml_key() {
Expand Down

0 comments on commit b352356

Please sign in to comment.