mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-04 18:19:27 +00:00
Add support for Rust Edition 2024
This commit is contained in:
parent
94b922d27a
commit
1e4d4887e1
3 changed files with 7 additions and 0 deletions
|
@ -345,6 +345,9 @@ impl MDBook {
|
|||
RustEdition::E2021 => {
|
||||
cmd.args(["--edition", "2021"]);
|
||||
}
|
||||
RustEdition::E2024 => {
|
||||
cmd.args(["--edition", "2024", "-Zunstable-options"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -504,6 +504,9 @@ pub struct RustConfig {
|
|||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
||||
/// Rust edition to use for the code.
|
||||
pub enum RustEdition {
|
||||
/// The 2024 edition of Rust
|
||||
#[serde(rename = "2024")]
|
||||
E2024,
|
||||
/// The 2021 edition of Rust
|
||||
#[serde(rename = "2021")]
|
||||
E2021,
|
||||
|
|
|
@ -902,6 +902,7 @@ fn add_playground_pre(
|
|||
Some(RustEdition::E2015) => " edition2015",
|
||||
Some(RustEdition::E2018) => " edition2018",
|
||||
Some(RustEdition::E2021) => " edition2021",
|
||||
Some(RustEdition::E2024) => " edition2024",
|
||||
None => "",
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue