Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions compiler/base/modify-cargo-toml/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ fn main() {
let mut cargo_toml: Value = toml::from_str(&input)
.unwrap_or_else(|e| panic!("Cannot parse {} as TOML: {}", input_filename.display(), e));

if env::var_os("PLAYGROUND_FEATURE_EDITION2021").is_some() {
cargo_toml = set_feature_edition2021(cargo_toml);
}

if let Ok(edition) = env::var("PLAYGROUND_EDITION") {
cargo_toml = set_edition(cargo_toml, &edition);
}
Expand Down Expand Up @@ -66,22 +62,6 @@ fn ensure_string_in_vec(values: &mut Vec<String>, val: &str) {
}
}

fn set_feature_edition2021(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, "edition2021");
cargo_toml
})
}

fn set_edition(cargo_toml: Value, edition: &str) -> Value {
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
Expand Down
4 changes: 0 additions & 4 deletions ui/src/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,10 +753,6 @@ impl DockerCommandExt for Command {

fn apply_edition(&mut self, req: impl EditionRequest) {
if let Some(edition) = req.edition() {
if edition == Edition::Rust2021 {
self.args(&["--env", &format!("PLAYGROUND_FEATURE_EDITION2021=true")]);
}

self.args(&["--env", &format!("PLAYGROUND_EDITION={}", edition.cargo_ident())]);
}
}
Expand Down