Rollup merge of #94461 - jhpratt:2024-edition, r=pnkfelix
Create (unstable) 2024 edition [On Zulip](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Deprecating.20macro.20scoping.20shenanigans/near/272860652), there was a small aside regarding creating the 2024 edition now as opposed to later. There was a reasonable amount of support and no stated opposition. This change creates the 2024 edition in the compiler and creates a prelude for the 2024 edition. There is no current difference between the 2021 and 2024 editions. Cargo and other tools will need to be updated separately, as it's not in the same repository. This change permits the vast majority of work towards the next edition to proceed _now_ instead of waiting until 2024. For sanity purposes, I've merged the "hello" UI tests into a single file with multiple revisions. Otherwise we'd end up with a file per edition, despite them being essentially identical. ````@rustbot```` label +T-lang +S-waiting-on-review Not sure on the relevant team, to be honest.
This commit is contained in:
commit
a11c79b821
@ -693,6 +693,7 @@ fn edition_from_edition_str(edition_str: &str) -> Result<Edition> {
|
|||||||
"2015" => Ok(Edition::Edition2015),
|
"2015" => Ok(Edition::Edition2015),
|
||||||
"2018" => Ok(Edition::Edition2018),
|
"2018" => Ok(Edition::Edition2018),
|
||||||
"2021" => Ok(Edition::Edition2021),
|
"2021" => Ok(Edition::Edition2021),
|
||||||
|
"2024" => Ok(Edition::Edition2024),
|
||||||
_ => Err(format_err!("Invalid value for `--edition`")),
|
_ => Err(format_err!("Invalid value for `--edition`")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -423,6 +423,10 @@ pub enum Edition {
|
|||||||
#[doc_hint = "2021"]
|
#[doc_hint = "2021"]
|
||||||
/// Edition 2021.
|
/// Edition 2021.
|
||||||
Edition2021,
|
Edition2021,
|
||||||
|
#[value = "2024"]
|
||||||
|
#[doc_hint = "2024"]
|
||||||
|
/// Edition 2024.
|
||||||
|
Edition2024,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Edition {
|
impl Default for Edition {
|
||||||
@ -437,6 +441,7 @@ fn from(edition: Edition) -> Self {
|
|||||||
Edition::Edition2015 => Self::Edition2015,
|
Edition::Edition2015 => Self::Edition2015,
|
||||||
Edition::Edition2018 => Self::Edition2018,
|
Edition::Edition2018 => Self::Edition2018,
|
||||||
Edition::Edition2021 => Self::Edition2021,
|
Edition::Edition2021 => Self::Edition2021,
|
||||||
|
Edition::Edition2024 => Self::Edition2024,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user