Rust News: Release of Rust 1.91.0

Rust News: Release of Rust 1.91.0

Core Updates: Platform support for Windows on Arm64 upgraded to Tier 1; lint checks for dangling raw pointers; stabilization of numerous APIs; Cargo updates stable build.build-dir configuration

1. Platform Support

The target aarch64-pc-windows-msvc, which is Windows on Arm64, now enjoys the highest level of support assurance.

Rust uses a clear tiered system (Tier 1, 2, 3) to indicate the level of support for different target platforms.Tier 3: Compiler support, but no guarantee of successful builds and tests, no precompiled binaries provided.Tier 2: Guarantees builds and provides precompiled binaries, but does not run the full test suite.Tier 1: Provides the highest level of support assurance.

2. Compilation Safety Checks

Lint checks for dangling raw pointers

Consider the following code’s output on Rust 1.90, on Mac aarch64 the result is <span>ptr1: 0</span>, which is undefined behavior, where ptr1 is a dangling pointer. In different platform compilation scenarios, it may output random values or even cause a segmentation fault (Segmentation Fault) Panic.

fn main() {
    unsafe {
        let ptr1 = f();
        println!("ptr1: {}", *ptr1);
    }
}

fn f() -> *const u8 {
    let x = 10;
    &x
}

On Rust 1.91, a compiler warning ⚠️ will occur, as follows:

warning: a dangling pointer will be produced because the local variable `x` will be dropped
  --> src/bin/test_dangling.rs:10:5
   |
 8 | fn f() -> *const u8 {
   |           --------- return type of the function is `*const u8`
 9 |     let x = 10;
   |         - `x` is part the function and will be dropped at the end of the function
10 |     &x
   |     ^^ 
   |
   = note: pointers do not have a lifetime; after returning, the `u8` will be deallocated at the end of the function because nothing is referencing it as far as the type system is concerned
   = note: `#[warn(dangling_pointers_from_locals)]` on by default

3. Stabilized APIs

60 new APIs have been stabilized, and 7 previously stabilized APIs are now usable in constant contexts.

4. Cargo Updates

Stabilized the build.build-dir configuration, allowing the setting of the directory for storing Cargo and rustc intermediate build artifacts.

For more details, see:Rust Blog.

https://blog.rust-lang.org/2025/10/30/Rust-1.91.0/

Leave a Comment