Rust 2024 (upd.)

Posted Feb 01, 2025. Updated Feb 10, 2025  ‐  6 min read

When?

If everything goes according to plan, Rust 1.85.0, which should be released on 2025-02-20, will introduce a new 2024 edition.

What did the beginning look like?

Before the release of Rust 1.0.0, compiler developers released an article Stability as a Deliverable that describes Rust's commitment to stability and safety. Before the 1.0.0 release, Rust was in a stage of rapid growth. Things had to calm down.

Compiler developers committed to developing Rust in 3 channels.

An unstable channel allows developers to use unstable, flag-guarded features. Currently, there are over 650 language and compiler features that are marked unstable. These features will be stabilized over the years and enabled in a stable channel. Some of them may be removed if compiler developers realize that no longer make sense.

The beta channel is intended for testing new stable releases. On this channel unstable features are disabled. By using this channel you can use only new features that are stabilized for new releases.

A stable channel is intended for everyday development use. Like in the beta channel, unstable features are disabled in stable compiler releases.

Another commitment was to release a new version every six weeks.

This approach allows Rust compiler developers to stabilize longer-developed features and deliver them in a predictable time manner.

Why editions idea come up?

The problem with the initial stable development model was that the introduction of some new language features was not possible without breaking compatibility promises.

This problem was resolved by the introduction of the edition concept in late 2017. First, the 1.0.0 release was called the Rust 2015 edition. The next version that introduced non-compatible changes was called the Rust 2018 edition.

This concept resolved the problem with the introduction of large compatibility-breaking changes. Developers who wanted new, not compatible features had to migrate to a new 2018 edition. Developers who didn't want these features didn't have to do anything. Their code should work on new releases.

What changes are introduced in the Rust 2024 edition?

Rust 2018 introduced 5 changes. Rust 2021 introduced 10 changes. Rust 2024 will introduce 21 changes. Fortunately, some of them can be introduced automatically by running:

cargo fix --edition

Migrating to other features will require rewriting some code.

Here is a full list of expected changes as of today:

Should you update to the 2024 edition?

It depends.

If you are the developer of an application and you want to use new features, then yes.

If you are the developer of an application and you don't want these new features, then maybe. Rust developers are not forcing you to update to a new edition if you don't want it. They also are not forbidding you from using new stabilized features unless they don't depend on the new edition. But unless you have reasons to not update, it's better to update and go forward together with the rest of the ecosystem.

What's next?

Changes introduced by Rust 2024 are not revolutionary. At the time of writing edition 2024 has the following description:

"Our motivating priorities for this edition are to: Make this edition a success. Do so without requiring heroics from anyone. ...or stressing anyone or everyone out."

I think it resonates pretty well with the ecosystem. Rust compiler developers don't want to make a mistake that was made by Python developers when they released version 3.0. Edition 2024 contains a few nice features. Other nice features are delivered in each stable release.

Back in 2021, I hoped that edition 2024 would make async feature complete. I think there will be more work related to async in the 2027 edition. Maybe even 2030.

What does it show?

IMO it shows a language maturity. Small features are stabilized on each stable release's basics. Large features are not easy to introduce. Developers need to carefully analyze every aspect. That is why we may need to wait for some features a little longer. Some of the features that are available in unstable may be removed. (There is no compatibility guarantee for unstable features. If you use them, you do it at your own risk.)

In the next few years, I would expect more development effort to shift from delivering stabilized features to compiler optimizations. Definitely, Rust needs more work in this field.

Also, there is ongoing work on Rust Specification. I've read some rumors about it before and recently in the 2024 Rust Foundation Annual Report you may see that Rust Foundation is devoting 3% of its budget to that goal. My guess is that Rust Specification may be released shortly after the Rust 2024 edition release.

This makes Rust more boring for people who want new features and more interesting for people who want stabilization. At the time of writing Rust developers delivered 118 stable releases (minor and patch level) from the release of version 1.0.0 back in 2015-05-16. In the next article, I'll try to explore if the stability promise was delivered.

Tools usage disclosure. I'm not a native English speaker. I use the following tools to improve my wording: Google Translate, Grammarly, and Hemingway Editor. These tools use artificial intelligence. I use them only to improve my writing, not to generate content.