Skip to content

Tracking issue for release notes of #133349: Stabilize the 2024 edition #133364

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

Closed
3 tasks
rustbot opened this issue Nov 23, 2024 · 0 comments
Closed
3 tasks

Tracking issue for release notes of #133349: Stabilize the 2024 edition #133364

rustbot opened this issue Nov 23, 2024 · 0 comments
Labels
A-edition-2024 Area: The 2024 edition relnotes Marks issues that should be documented in the release notes of the next release. relnotes-tracking-issue Marks issues tracking what text to put in release notes. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Milestone

Comments

@rustbot
Copy link
Collaborator

rustbot commented Nov 23, 2024

This issue tracks the release notes text for #133349.

Steps

  • Proposed text is drafted by PR author (or team) making the noteworthy change.
  • Issue is nominated for release team review of clarity for wider audience.
  • Release team includes text in release notes/blog posts.

Release notes text

The responsible team for the underlying change should edit this section to replace the automatically generated link with a succinct description of what changed, drawing upon text proposed by the author (either in discussion or through direct editing).

# Language
- [The 2024 Edition is now stable.](https://github.com/rust-lang/rust/pull/133349)
  See [the edition guide](https://doc.rust-lang.org/nightly/edition-guide/rust-2024/index.html) for more details.

Tip

Use the previous releases categories to help choose which one(s) to use.
The category will be de-duplicated with all the other ones by the release team.

More than one section can be included if needed.

Release blog section

If the change is notable enough for inclusion in the blog post, the responsible team should add content to this section.
Otherwise leave it empty.

### Rust 2024

We are excited to announce that the Rust 2024 Edition is now stable!
Editions are a mechanism for opt-in changes that may otherwise pose a backwards compatibility risk. See [the edition guide](https://doc.rust-lang.org/edition-guide/editions/index.html) for details on how this is achieved, and detailed instructions on how to migrate.

This is the largest edition we have released. The [edition guide](https://doc.rust-lang.org/edition-guide/rust-2024/index.html) contains detailed information about each change, but as a summary, here are all the changes:

- Language
  - [RPIT lifetime capture rules](https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html) — Changes the default impl trait `use<..>` capturing.
  - [`if let` temporary scope](https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html) — Changes the scope of temporaries for `if let` expressions.
  - [Tail expression temporary scope](https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html) — Changes the scope of temporaries for the tail expression in a block.
  - [Match ergonomics reservations](https://doc.rust-lang.org/edition-guide/rust-2024/match-ergonomics.html) — New restrictions on pattern binding modes.
  - [Unsafe `extern` blocks](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-extern.html)`extern` blocks now require the `unsafe` keyword.
  - [Unsafe attributes](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html) — The `export_name`, `link_section`, and `no_mangle` attributes must now be marked as `unsafe`.
  - [`unsafe_op_in_unsafe_fn` warning](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html) — The [`unsafe_op_in_unsafe_fn`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unsafe-op-in-unsafe-fn) lint now warns by default, requiring explicit `unsafe {}` blocks in `unsafe` functions.
  - [Disallow references to `static mut`](https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html) — References to `static mut` items now generate a deny-by-default error.
  - [Never type fallback change](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) — Changes to how the never type `!` coerces, and changes the [`never_type_fallback_flowing_into_unsafe`](https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#never-type-fallback-flowing-into-unsafe) lint level to "deny".  
  - [Macro fragment specifiers](https://doc.rust-lang.org/edition-guide/rust-2024/macro-fragment-specifiers.html) — The `expr` macro fragment specifier in `macro_rules!` macros now also matches `const` and `_` expressions.
  - [Missing macro fragment specifiers](https://doc.rust-lang.org/edition-guide/rust-2024/missing-macro-fragment-specifiers.html) — The [`missing_fragment_specifier`](https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#missing-fragment-specifier) lint is now a hard error, rejecting macro meta variables without a fragment specifier kind.
  - [`gen` keyword](https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html) — Reserves the `gen` keyword in anticipation of adding generator blocks in the future.
  - [Reserved syntax](https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html) — Reserves `#"foo"#` style strings and `##` tokens in anticipation of changing how guarded string literals may change in the future.
- Standard library
  - [Changes to the prelude](https://doc.rust-lang.org/edition-guide/rust-2024/prelude.html) — Adds `Future` and `IntoFuture` to the prelude.
  - [Add `IntoIterator` for `Box<[T]>`](https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html) — Changes how iterators work with boxed slices.
  - [Newly unsafe functions](https://doc.rust-lang.org/edition-guide/rust-2024/newly-unsafe-functions.html)`std::env::set_var`, `std::env::remove_var`, and `std::os::unix::process::CommandExt::before_exec` are now unsafe functions.
- Cargo
  - [Cargo: Rust-version aware resolver](https://doc.rust-lang.org/edition-guide/rust-2024/cargo-resolver.html) — Changes the default dependency resolver behavior to consider the `rust-version` field.
  - [Cargo: Table and key name consistency](https://doc.rust-lang.org/edition-guide/rust-2024/cargo-table-key-names.html) — Removes some outdated `Cargo.toml` keys.
  - [Cargo: Reject unused inherited default-features](https://doc.rust-lang.org/edition-guide/rust-2024/cargo-inherited-default-features.html) — Changes how `default-features = false` works with inherited workspace dependencies.
- Rustdoc
  - [Rustdoc combined tests](https://doc.rust-lang.org/edition-guide/rust-2024/rustdoc-doctests.html) — Doctests are now combined into a single executable, significantly improving performance.
  - [Rustdoc nested `include!` change](https://doc.rust-lang.org/edition-guide/rust-2024/rustdoc-nested-includes.html) — Changes to the relative path behavior of nested `include!` files.
- Rustfmt
  - [Rustfmt: Style edition](https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-style-edition.html) — Introduces the concept of "style editions", which allow you to independently control the formatting edition from the Rust edition.
  - [Rustfmt: Formatting fixes](https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-formatting-fixes.html) — A large number of fixes to formatting various situations.
  - [Rustfmt: Combine all delimited exprs as last argument](https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-overflow-delimited-expr.html) — Changes to multi-line expressions as the last argument.
  - [Rustfmt: Raw identifier sorting](https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-raw-identifier-sorting.html) — Changes to how `r#foo` identifiers are sorted.
  - [Rustfmt: Version sorting](https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-version-sorting.html) — Changes to how identifiers that contain integers are sorted.

#### Migrating to 2024

The guide includes migration instructions for all new features, and in general
[transitioning an existing project to a new edition](https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html).
In many cases `cargo fix` can automate the necessary changes. You may even
find that no changes in your code are needed at all for 2024!

*Many* people came together to create this edition. We'd like to thank them all for their hard work!

<!-- consider a similar thanks thread like https://github.com/rust-lang/rust/issues/88623? -->

cc @ehuss, @traviscross -- origin issue/PR authors and assignees for starting to draft text

@rustbot rustbot added A-edition-2024 Area: The 2024 edition A-run-make Area: port run-make Makefiles to rmake.rs relnotes Marks issues that should be documented in the release notes of the next release. relnotes-tracking-issue Marks issues tracking what text to put in release notes. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 23, 2024
@rustbot rustbot added this to the 1.85.0 milestone Nov 23, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 23, 2024
@traviscross traviscross added T-lang Relevant to the language team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 23, 2024
@jieyouxu jieyouxu removed A-run-make Area: port run-make Makefiles to rmake.rs needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2024 Area: The 2024 edition relnotes Marks issues that should be documented in the release notes of the next release. relnotes-tracking-issue Marks issues tracking what text to put in release notes. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants