diff --git a/src/book/mod.rs b/src/book/mod.rs index e66615e2..92990ea8 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -345,6 +345,9 @@ impl MDBook { RustEdition::E2021 => { cmd.args(["--edition", "2021"]); } + RustEdition::E2024 => { + cmd.args(["--edition", "2024", "-Zunstable-options"]); + } } } diff --git a/src/config.rs b/src/config.rs index eba95286..1438be29 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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, diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index d304259a..080b12da 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -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 => "", } };