
On May 16, 2025, the highly anticipated Rust programming language welcomed its new stable version—Rust 1.87.0! As one of the leading, safest, and high-performance system-level languages in the industry, Rust continuously enhances the development experience and underlying technology through version upgrades. This 1.87.0 iteration brings several important new features and stability improvements, covering core language features, compiler optimizations, library function upgrades, platform support adjustments, and Cargo package management updates. Today, we will deeply analyze all the highlights and changes of Rust 1.87.0, helping you navigate the Rust ecosystem and embrace the new programming wave of the next five years!
1. Language Features Upgraded: A More Flexible and Efficient Rust Coding Experience
1. The asm_goto feature is officially stabilized, significantly enhancing the flexibility of inline assembly
Rust previously only supported basic inline assembly. The 1.87.0 version stabilizes the <span>asm_goto</span> feature, allowing assembly code to jump based on runtime conditions, suitable for complex low-level logic control scenarios, greatly enhancing the expressiveness and performance optimization potential of embedded assembly code.
2. New unified open interval parsing rules added, supporting <span>..EXPR</span> immediately following unary operators
Previously, Rust had ambiguities when parsing structures like <span>!-..expr</span>. The 1.87.0 version optimizes the syntax parser to support parsing expressions like <span>! ..expr</span>, <span>- ..expr</span>, and <span>* ..expr</span><code><span>, making interval expressions more concise and syntactically robust.</span>
3. The impl for unsized types is more friendly, no longer requiring Self to be Sized
Rust’s support for unsized types (such as dynamically sized types) continues to improve. The 1.87.0 version reduces the restrictions in impl definitions that methods must satisfy Self: Sized, providing greater flexibility for writing methods for dynamically sized types, aiding various advanced abstraction libraries and low-level system development.
4. The precise_capturing_in_traits feature is stabilized
Using <span>use<...></span> boundaries in traits to precisely capture the characteristics of return types is finally stabilized, achieving finer control over generic parameters when returning impl Trait from traits, greatly enhancing the expressiveness and flexibility of trait definitions.
2. Compiler Optimizations: Smarter and Safer Low-Level Calls and Platform Adaptation
1. SSE2 support is enforced for the i686 architecture, enhancing SIMD type processing capabilities
In version 1.87.0, Rust adjusts the default instruction set for the x86 target architecture, explicitly requiring i686 to enable the SSE2 instruction set, allowing for more efficient processing of SIMD type parallel data, improving performance on 32-bit platform code.
2. Removal of the outdated i586-pc-windows-msvc target, focusing on mainstream supported platforms
To better concentrate resources and support the ecosystem, the Rust team has removed support for the outdated hardware architecture i586’s MSVC Windows target. Developers need to adjust migration strategies based on the official platform support page to ensure code compatibility and stability.
3. Standard Library Evolution: Enriching General-Purpose APIs to Enhance Development Convenience
1. Anonymous pipe API officially stabilized, simplifying inter-process data flow
The APIs related to anonymous pipes (<span>io::pipe</span>) and the <span>PipeReader</span>/<span>PipeWriter</span> types are officially stabilized, making it easier for developers to implement inter-process data communication, enhancing the efficiency and reliability of system programming and service calls.
2. Support for unbounded left/right shift operations
Support for unbounded left shift (<span>unbounded_shl</span>) and right shift (<span>unbounded_shr</span>) has been added to integer types, suitable for advanced numerical calculations and bit manipulation scenarios.
3. Vec’s with_capacity guarantees pre-allocated memory size
The <span>with_capacity</span> method of Vec has been improved to guarantee that at least the requested memory size is allocated, avoiding performance fluctuations caused by resizing, improving memory allocation accuracy and program stability.
4. Most std::arch inline assembly built-in functions without pointer parameters can now be called in safe code
This means that as long as the target feature is enabled, you can call these low-level optimization functions without using unsafe blocks, significantly reducing security risks and code complexity.
5. The env::home_dir API removes deprecation warnings, facilitating cross-platform access to the user’s home directory
The previously deprecated <span>env::home_dir</span> method has been re-enabled to meet the needs of daily development for accessing home directory paths.
6. Macros like assert_eq! and vec! support const block expressions
The macro system has been significantly enhanced, allowing common macros to be called within <span>const{}</span> constant blocks, bringing more flexible compile-time computation capabilities.
4. Important API Stabilization List (Core Highlights)
- • Collection type extension methods:
- •
<span>Vec::extract_if</span>three variants (Vec/List) are stabilized, conveniently and efficiently removing elements that meet conditions from collections. - •
<span>[T]</span>slice’s<span>split_off</span>series of methods support various splitting operations, both mutable and immutable. - •
<span>String::extend_from_within</span>added to extend from a certain range within itself; - • Enhancements to platform-related display APIs for strings and OsStr;
- • Raw pointer Debug implementation now outputs metadata, improving the debugging experience;
- •
<span>Box<MaybeUninit<T>>::write</span>safely and efficiently writes to uninitialized memory. - • Pointer and non-null pointer support for unsigned offset and various operations;
- • Integer types support unbounded left/right shifts and signed/unsigned type conversions;
- • Multiple string operations such as
<span>from_utf8</span>now support const context calls.
5. Cargo Package Manager Upgrade Highlights
- • Terminal integration achieved through ANSI OSC 9;4 sequences, enhancing interactive display performance in the terminal, making the build experience smoother.
- • OpenSSL version upgraded to v3, more secure and better compatibility.
- • New
<span>--exclude-lockfile</span>option added for flexible control over the package management process.
6. Compatibility Warnings and Major Change Reminders
- • Macro calls are prohibited within
<span>#![crate_name]</span>attributes to avoid startup errors. - • Unstable fields are now non-null by default, affecting some data structure designs.
- • Dynamic type associated types are no longer automatically deduplicated, requiring code modifications for adaptation.
- • Native pointer Debug implementation is more detailed, which may introduce new unused unsafe warnings.
- • The Windows platform no longer links advapi32.dll by default (except for win7), and dependents must declare it themselves.
- • Macro fragment paste logic changes, and some previously accepted macro definitions are no longer accepted.
7. Summary and Outlook
The Rust 1.87.0 version not only brings improvements to the core syntax and type system of the language but also achieves qualitative leaps in compiler platform support, standard library APIs, and the Cargo toolchain. The new version aims to enable developers to write safer and higher-performance system code while lowering development thresholds and operational complexity. For system-level developers pursuing performance limits and safety guarantees, upgrading to Rust 1.87.0 is undoubtedly a key step towards the future.
As members of the open-source community, we encourage you to try out these new features and provide feedback on your experience, jointly promoting the prosperity and maturity of the Rust ecosystem. In 2025, Rust will continue to lead the new trend of safe and efficient programming, so stay tuned for more innovations!
Appendix: Official Link to Detailed Version Updates
Official Rust 1.87.0 release page[1]
Reference Link
<span>[1]</span> Official Rust 1.87.0 release page: https://github.com/rust-lang/rust/releases/tag/1.87.0
·
We believe that artificial intelligence provides an “enhancement tool” for ordinary people and are committed to sharing comprehensive AI knowledge. Here, you can find the latest AI popular science articles, tool evaluations, efficiency-enhancing tips, and industry insights.
We welcome you to follow “Fudada Architect’s Daily Question” and let AI assist your future development.
·