Rust 1.91.0 stable version released

Rust 1.91.0 stable version released

1 year ago
duguying
46 views
Source: RustLang

The Rust team is excited to announce the release of Rust version 1.91.0. Rust is a programming language that enables everyone to build reliable and efficient software.

Related tags

#rust

The Rust team is excited to announce the release of Rust version 1.91.0. Rust is a programming language that enables everyone to build reliable and efficient software.

If you previously installed an older version of Rust, rustup , via apt, you can obtain version 1.91.0 using the following command:

 What does stable version 1.91.0 include? rustup update stable 

aarch64-pc-windows-msvc is now a Tier 1 platform.

The Rust compiler supports multiple target platforms, but the Rust team cannot provide equal support for all platforms. To clearly indicate the level of support for each target platform, we use a hierarchical system:

  • The compiler technically supports Tier 3 targets, but we do not check whether its code can be built or pass tests, nor do we provide any pre-built binaries in the release.
  • The secondary target platform guarantees that it can be built, and we provide pre-built binaries, but we will not run the test suite on these platforms: the generated binaries may not work or may contain errors.
  • Tier 1 target platforms offer the highest level of support guarantees; for every change merged into the compiler, we run a full test suite on these platforms. Additionally, we provide pre-compiled binaries.

Rust 1.91.0 elevates aarch64-pc-windows-msvc target platform to Tier 1 support, providing the highest level of guarantees for users of 64-bit ARM systems running Windows.

Add lint rules for dangling raw pointers in local variables.

While Rust’s borrow checking prevents dangling references from being returned, it doesn’t track raw pointers. In this release, we’ve added a lint with a default warning to check for raw pointers to local variables returned by functions. For example, code like this:

 fn f() -> *const u8 { let x = 0; &x } This will now generate a lint warning: fn f() -> *const u8 { let x = 0; &x }
 warning: a dangling pointer will be produced because the local variable `x` will be dropped --> src/lib.rs:3:5 | 1 | fn f() -> *const u8 { | --------- return type of the function is `*const u8` 2 | let x = 0; | - `x` is part the function and will be dropped at the end of the function 3 | &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 Please note that the code above is not inherently dangerous because it does not perform any dangerous operations. Dereferencing a raw pointer after the function returns is unsafe. We expect future versions of Rust to add more features to help developers handle raw pointers safely, and unsafe code in a broader sense. warning: a dangling pointer will be produced because the local variable `x` will be dropped --> src/lib.rs:3:5 | 1 | fn f() -> *const u8 { | --------- return type of the function is `*const u8` 2 | let x = 0; | - `x` is part the function and will be dropped at the end of the function 3 | &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

Platform support

  • Promoted aarch64-pc-windows-msvc to Level 1
  • aarch64-pc-windows-gnullvm uses host tools to elevate x86_64-pc-windows-gnullvm to level two. Note: llvm-tools and the MSI installer are currently missing but will be added in a future release.

For more information on Rust’s hierarchical platform support, please see the Rust platform support page.

More News

Want to see more quality content?

Browse all news