Skip to content

Document the edition2024 code block attribute #2707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
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
2 changes: 1 addition & 1 deletion guide/src/format/configuration/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ edition = "2015" # the default edition for code blocks

- **edition**: Rust edition to use by default for the code snippets. Default
is `"2015"`. Individual code blocks can be controlled with the `edition2015`,
`edition2018` or `edition2021` annotations, such as:
`edition2018`, `edition2021` or `edition2024` annotations, such as:

~~~text
```rust,edition2015
Expand Down
2 changes: 1 addition & 1 deletion guide/src/format/mdbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ These use the same attributes as [rustdoc attributes], with a few additions:
* `no_run` --- The code is compiled when tested, but it is not run.
The play button is also not shown.
* `compile_fail` --- The code should fail to compile.
* `edition2015`, `edition2018`, `edition2021` --- Forces the use of a specific Rust edition.
* `edition2015`, `edition2018`, `edition2021`, `edition2024` --- Forces the use of a specific Rust edition.
See [`rust.edition`] to set this globally.

[`mdbook test`]: ../cli/test.md
Expand Down