-
Notifications
You must be signed in to change notification settings - Fork 304
Announce Rust 1.89.0 #1666
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
base: master
Are you sure you want to change the base?
Announce Rust 1.89.0 #1666
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,80 @@ | ||||||||||||||||||||||||||||||
+++ | ||||||||||||||||||||||||||||||
path = "2025/08/07/Rust-1.89.0" | ||||||||||||||||||||||||||||||
title = "Announcing Rust 1.89.0" | ||||||||||||||||||||||||||||||
authors = ["The Rust Release Team"] | ||||||||||||||||||||||||||||||
aliases = ["releases/1.89.0"] | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
[extra] | ||||||||||||||||||||||||||||||
release = true | ||||||||||||||||||||||||||||||
+++ | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
The Rust team is happy to announce a new version of Rust, 1.89.0. Rust is a programming language empowering everyone to build reliable and efficient software. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
If you have a previous version of Rust installed via `rustup`, you can get 1.89.0 with: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
```console | ||||||||||||||||||||||||||||||
$ rustup update stable | ||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
If you don't have it already, you can [get `rustup`](https://www.rust-lang.org/install.html) from the appropriate page on our website, and check out the [detailed release notes for 1.89.0](https://doc.rust-lang.org/stable/releases.html#version-1890-2025-08-07). | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please [report](https://github.com/rust-lang/rust/issues/new/choose) any bugs you might come across! | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## What's in 1.89.0 stable | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### Explicitly inferred arguments to const generics | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Rust now supports `_` as an argument to const generic parameters, inferring the value from surrounding context: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
```rust | ||||||||||||||||||||||||||||||
pub fn make_bitset<const LEN: usize>() -> [bool; LEN] { | ||||||||||||||||||||||||||||||
[false; _] | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Similar to the rules for when `_` is permitted as a type, `_` is not permitted as an argument to const generics when in a signature: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
```rust | ||||||||||||||||||||||||||||||
// This is not allowed | ||||||||||||||||||||||||||||||
pub const fn make_bitset<const LEN: usize>() -> [bool; _] { | ||||||||||||||||||||||||||||||
[false; LEN] | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
// Neither is this | ||||||||||||||||||||||||||||||
pub const MY_BITSET: [bool; _] = make_bitset::<10>(); | ||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### Mismatched lifetimes syntax lint | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
TC/LANG to write this | ||||||||||||||||||||||||||||||
Comment on lines
+46
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mismatched lifetime syntaxes lintLifetime elision in function signatures is an ergonomic aspect of the Rust language, but it can also be a stumbling point for newcomers and experts alike. This is especially true when lifetimes are inferred in types where it isn't syntactically obvious that a lifetime is even present: // The returned type `std::slice::Iter` has a lifetime,
// but there's no visual indication of that.
//
// Lifetime elision infers the lifetime of the return
// value to be the same as the argument `scores`.
fn items(scores: &[u8]) -> std::slice::Iter<u8> {
scores.iter()
} Code like this will now produce a warning by default:
We first attempted to improve this situation back in 2018 as part of the use std::fmt;
struct Greeting;
impl fmt::Display for Greeting {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// -----^^^^^^^^^ expected lifetime parameter
// Knowing that `Formatter` has a lifetime does not help the programmer
"howdy".fmt(f)
}
} We then realized that the confusion we want to eliminate occurs when both
There are two pieces of Rust syntax that indicate that a lifetime exists:
The Because the input and output lifetimes belong to different groups, the lint will warn about this function, reducing confusion about when a value has a meaningful lifetime that isn't visually obvious. The Future work on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's great. Thanks for writing that up. One thing that I would like us to get in there somewhere is that we consider the lifetime in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I took a stab at that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the compiler output above seems to have lost There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I took that out because it comes and goes (is it the first warning, is it set on the command line, etc.) I can add it back if you think it’s useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth keeping, yes. |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### More x86 target features | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
The `target_feature` attribute now supports the `sha512`, `sm3`, `sm4`, `kl` and `widekl` target features on x86. Additionally a number of `avx512` intrinsics and target features are also supported on x86: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
```rust | ||||||||||||||||||||||||||||||
#[target_feature(enable = "avx512bw")] | ||||||||||||||||||||||||||||||
pub fn cool_simd_code(/* .. */) -> /* ... */ { | ||||||||||||||||||||||||||||||
/* ... */ | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
Comment on lines
+52
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also specify that all avx512 intrinsics in Edit: nvm I didn't see it right |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're playing a little fast and loose with the timing of this announcement, but the "worst" case is that we extend support one more release, which people are unlikely to be unhappy about.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe s/x86_64 macOS/ |
||||||||||||||||||||||||||||||
### Platform Support | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
- [Add new Tier-3 targets `loongarch32-unknown-none` and `loongarch32-unknown-none-softfloat`](https://github.com/rust-lang/rust/pull/142053) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Refer to Rust’s [platform support page][platform_support_page] for more information on Rust’s tiered platform support. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### Stabilized APIs | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
TODO | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### Other changes | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.89.0), [Cargo](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-189-2025-08-07), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-189). | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Contributors to 1.89.0 | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Many people came together to create Rust 1.89.0. We couldn't have done it without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.89.0/) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
[platform_support_page]: https://doc.rust-lang.org/rustc/platform-support.html |
Uh oh!
There was an error while loading. Please reload this page.