|
| 1 | ++++ |
| 2 | +path = "2025/10/30/Rust-1.91.0" |
| 3 | +title = "Announcing Rust 1.91.0" |
| 4 | +authors = ["The Rust Release Team"] |
| 5 | +aliases = ["releases/1.91.0"] |
| 6 | + |
| 7 | +[extra] |
| 8 | +release = true |
| 9 | ++++ |
| 10 | + |
| 11 | +The Rust team is happy to announce a new version of Rust, 1.91.0. Rust is a programming language empowering everyone to build reliable and efficient software. |
| 12 | + |
| 13 | +If you have a previous version of Rust installed via `rustup`, you can get 1.91.0 with: |
| 14 | + |
| 15 | +```console |
| 16 | +$ rustup update stable |
| 17 | +``` |
| 18 | + |
| 19 | +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.91.0](https://doc.rust-lang.org/stable/releases.html#version-1910-2025-10-30). |
| 20 | + |
| 21 | +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! |
| 22 | + |
| 23 | +## What's in 1.91.0 stable |
| 24 | + |
| 25 | +### `aarch64-pc-windows-msvc` is now a Tier 1 platform |
| 26 | + |
| 27 | +The Rust compiler supports [a wide variety of targets][platform-support], but |
| 28 | +the Rust Team can't provide the same level of support for all of them. To |
| 29 | +clearly mark how supported each target is, we use a tiering system: |
| 30 | + |
| 31 | +* Tier 3 targets are technically supported by the compiler, but we don't check |
| 32 | + whether their code build or passes the tests, and we don't provide any |
| 33 | + prebuilt binaries as part of our releases. |
| 34 | +* Tier 2 targets are guaranteed to build and we provide prebuilt binaries, but |
| 35 | + we don't execute the test suite on those platforms: the produced binaries |
| 36 | + might not work or might have bugs. |
| 37 | +* Tier 1 targets provide the highest support guarantee, and we run the full |
| 38 | + suite on those platforms for every change merged in the compiler. Prebuilt |
| 39 | + binaries are also available. |
| 40 | + |
| 41 | +Rust 1.91.0 promotes the `aarch64-pc-windows-msvc` target to Tier 1 support, |
| 42 | +bringing our highest guarantees to users of 64-bit ARM systems running Windows. |
| 43 | + |
| 44 | +### Add lint against dangling raw pointers from local variables |
| 45 | + |
| 46 | +While Rust's borrow checking prevents dangling references from being returned, it doesn't |
| 47 | +track raw pointers. With this release, we are adding a warn-by-default lint on raw |
| 48 | +pointers to local variables being returned from functions. For example, code like this: |
| 49 | + |
| 50 | +```rust |
| 51 | +fn f() -> *const u8 { |
| 52 | + let x = 0; |
| 53 | + &x |
| 54 | +} |
| 55 | +``` |
| 56 | + |
| 57 | +will now produce a lint: |
| 58 | + |
| 59 | +``` |
| 60 | +warning: a dangling pointer will be produced because the local variable `x` will be dropped |
| 61 | + --> src/lib.rs:3:5 |
| 62 | + | |
| 63 | +1 | fn f() -> *const u8 { |
| 64 | + | --------- return type of the function is `*const u8` |
| 65 | +2 | let x = 0; |
| 66 | + | - `x` is part the function and will be dropped at the end of the function |
| 67 | +3 | &x |
| 68 | + | ^^ |
| 69 | + | |
| 70 | + = note: pointers do not have a lifetime; after returning, the `u8` will be deallocated |
| 71 | + at the end of the function because nothing is referencing it as far as the type system is |
| 72 | + concerned |
| 73 | + = note: `#[warn(dangling_pointers_from_locals)]` on by default |
| 74 | +``` |
| 75 | + |
| 76 | +Note that the code above is not unsafe, as it itself doesn't perform any dangerous |
| 77 | +operations. Only dereferencing the raw pointer after the function returns would be |
| 78 | +unsafe. We expect future releases of Rust to add more functionality helping authors |
| 79 | +to safely interact with raw pointers, and with unsafe code more generally. |
| 80 | + |
| 81 | +### Stabilized APIs |
| 82 | + |
| 83 | +- [`Path::file_prefix`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.file_prefix) |
| 84 | +- [`AtomicPtr::fetch_ptr_add`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_ptr_add) |
| 85 | +- [`AtomicPtr::fetch_ptr_sub`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_ptr_sub) |
| 86 | +- [`AtomicPtr::fetch_byte_add`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_byte_add) |
| 87 | +- [`AtomicPtr::fetch_byte_sub`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_byte_sub) |
| 88 | +- [`AtomicPtr::fetch_or`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_or) |
| 89 | +- [`AtomicPtr::fetch_and`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_and) |
| 90 | +- [`AtomicPtr::fetch_xor`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_xor) |
| 91 | +- [`{integer}::strict_add`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_add) |
| 92 | +- [`{integer}::strict_sub`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_sub) |
| 93 | +- [`{integer}::strict_mul`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_mul) |
| 94 | +- [`{integer}::strict_div`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_div) |
| 95 | +- [`{integer}::strict_div_euclid`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_div_euclid) |
| 96 | +- [`{integer}::strict_rem`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_rem) |
| 97 | +- [`{integer}::strict_rem_euclid`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_rem_euclid) |
| 98 | +- [`{integer}::strict_neg`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_neg) |
| 99 | +- [`{integer}::strict_shl`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_shl) |
| 100 | +- [`{integer}::strict_shr`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_shr) |
| 101 | +- [`{integer}::strict_pow`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_pow) |
| 102 | +- [`i{N}::strict_add_unsigned`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_add_unsigned) |
| 103 | +- [`i{N}::strict_sub_unsigned`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_sub_unsigned) |
| 104 | +- [`i{N}::strict_abs`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_abs) |
| 105 | +- [`u{N}::strict_add_signed`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_add_signed) |
| 106 | +- [`u{N}::strict_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_sub_signed) |
| 107 | +- [`PanicHookInfo::payload_as_str`](https://doc.rust-lang.org/stable/std/panic/struct.PanicHookInfo.html#method.payload_as_str) |
| 108 | +- [`core::iter::chain`](https://doc.rust-lang.org/stable/core/iter/fn.chain.html) |
| 109 | +- [`u{N}::checked_signed_diff`](https://doc.rust-lang.org/stable/std/primitive.u16.html#method.checked_signed_diff) |
| 110 | +- [`core::array::repeat`](https://doc.rust-lang.org/stable/core/array/fn.repeat.html) |
| 111 | +- [`PathBuf::add_extension`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.add_extension) |
| 112 | +- [`PathBuf::with_added_extension`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.with_added_extension) |
| 113 | +- [`Duration::from_mins`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_mins) |
| 114 | +- [`Duration::from_hours`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_hours) |
| 115 | +- [`impl PartialEq<str> for PathBuf`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#impl-PartialEq%3Cstr%3E-for-PathBuf) |
| 116 | +- [`impl PartialEq<String> for PathBuf`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#impl-PartialEq%3CString%3E-for-PathBuf) |
| 117 | +- [`impl PartialEq<str> for Path`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#impl-PartialEq%3Cstr%3E-for-Path) |
| 118 | +- [`impl PartialEq<String> for Path`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#impl-PartialEq%3CString%3E-for-Path) |
| 119 | +- [`impl PartialEq<PathBuf> for String`](https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-PartialEq%3CPathBuf%3E-for-String) |
| 120 | +- [`impl PartialEq<Path> for String`](https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-PartialEq%3CPath%3E-for-String) |
| 121 | +- [`impl PartialEq<PathBuf> for str`](https://doc.rust-lang.org/stable/std/primitive.str.html#impl-PartialEq%3CPathBuf%3E-for-str) |
| 122 | +- [`impl PartialEq<Path> for str`](https://doc.rust-lang.org/stable/std/primitive.str.html#impl-PartialEq%3CPath%3E-for-str) |
| 123 | +- [`Ipv4Addr::from_octets`](https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.from_octets) |
| 124 | +- [`Ipv6Addr::from_octets`](https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.from_octets) |
| 125 | +- [`Ipv6Addr::from_segments`](https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.from_segments) |
| 126 | +- [`impl<T> Default for Pin<Box<T>> where Box<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CBox%3CT%3E%3E) |
| 127 | +- [`impl<T> Default for Pin<Rc<T>> where Rc<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CRc%3CT%3E%3E) |
| 128 | +- [`impl<T> Default for Pin<Arc<T>> where Arc<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CArc%3CT%3E%3E) |
| 129 | +- [`Cell::as_array_of_cells`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.as_array_of_cells) |
| 130 | +- [`u{N}::carrying_add`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_add) |
| 131 | +- [`u{N}::borrowing_sub`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.borrowing_sub) |
| 132 | +- [`u{N}::carrying_mul`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_mul) |
| 133 | +- [`u{N}::carrying_mul_add`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_mul_add) |
| 134 | +- [`BTreeMap::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html#method.extract_if) |
| 135 | +- [`BTreeSet::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeSet.html#method.extract_if) |
| 136 | +- [`impl Debug for windows::ffi::EncodeWide<'_>`](https://doc.rust-lang.org/stable/std/os/windows/ffi/struct.EncodeWide.html#impl-Debug-for-EncodeWide%3C'_%3E) |
| 137 | +- [`str::ceil_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.ceil_char_boundary) |
| 138 | +- [`str::floor_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.floor_char_boundary) |
| 139 | +- [`impl Sum for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Sum-for-Saturating%3Cu32%3E) |
| 140 | +- [`impl Sum<&Self> for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Sum%3C%26Saturating%3Cu32%3E%3E-for-Saturating%3Cu32%3E) |
| 141 | +- [`impl Product for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Product-for-Saturating%3Cu32%3E) |
| 142 | +- [`impl Product<&Self> for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Product%3C%26Saturating%3Cu32%3E%3E-for-Saturating%3Cu32%3E) |
| 143 | + |
| 144 | +These previously stable APIs are now stable in const contexts: |
| 145 | + |
| 146 | +- [`<[T; N]>::each_ref`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref) |
| 147 | +- [`<[T; N]>::each_mut`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut) |
| 148 | +- [`OsString::new`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.new) |
| 149 | +- [`PathBuf::new`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.new) |
| 150 | +- [`TypeId::of`](https://doc.rust-lang.org/stable/std/any/struct.TypeId.html#method.of) |
| 151 | +- [`ptr::with_exposed_provenance`](https://doc.rust-lang.org/stable/std/ptr/fn.with_exposed_provenance.html) |
| 152 | +- [`ptr::with_exposed_provenance_mut`](https://doc.rust-lang.org/stable/std/ptr/fn.with_exposed_provenance_mut.html) |
| 153 | + |
| 154 | +### Platform Support |
| 155 | + |
| 156 | +- [Promote `aarch64-pc-windows-msvc` to Tier 1](https://github.com/rust-lang/rust/pull/145682) |
| 157 | +- [Promote `aarch64-pc-windows-gnullvm` and `x86_64-pc-windows-gnullvm` to Tier 2 with host tools.](https://github.com/rust-lang/rust/pull/143031) |
| 158 | + Note: llvm-tools and MSI installers are missing but will be added in future releases. |
| 159 | + |
| 160 | +Refer to Rust’s [platform support page][platform-support] for more information on Rust’s tiered platform support. |
| 161 | + |
| 162 | +### Other changes |
| 163 | + |
| 164 | +Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.91.0), [Cargo](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-191-2025-10-30), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-191). |
| 165 | + |
| 166 | +## Contributors to 1.91.0 |
| 167 | + |
| 168 | +Many people came together to create Rust 1.91.0. We couldn't have done it without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.91.0/) |
| 169 | + |
| 170 | +[platform-support]: https://doc.rust-lang.org/rustc/platform-support.html |
0 commit comments