Skip to content

Commit 3bdcc0a

Browse files
authored
Merge pull request #2398 from ehuss/edition2024
Add support for Rust Edition 2024
2 parents 94b922d + 1e4d488 commit 3bdcc0a

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/book/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ impl MDBook {
345345
RustEdition::E2021 => {
346346
cmd.args(["--edition", "2021"]);
347347
}
348+
RustEdition::E2024 => {
349+
cmd.args(["--edition", "2024", "-Zunstable-options"]);
350+
}
348351
}
349352
}
350353

src/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ pub struct RustConfig {
504504
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
505505
/// Rust edition to use for the code.
506506
pub enum RustEdition {
507+
/// The 2024 edition of Rust
508+
#[serde(rename = "2024")]
509+
E2024,
507510
/// The 2021 edition of Rust
508511
#[serde(rename = "2021")]
509512
E2021,

src/renderer/html_handlebars/hbs_renderer.rs

+1
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ fn add_playground_pre(
902902
Some(RustEdition::E2015) => " edition2015",
903903
Some(RustEdition::E2018) => " edition2018",
904904
Some(RustEdition::E2021) => " edition2021",
905+
Some(RustEdition::E2024) => " edition2024",
905906
None => "",
906907
}
907908
};

0 commit comments

Comments
 (0)