The stable release of Rust 1.97.0, launched on June 12, 2026, brings key improvements for developers writing kernel-space code and system tools. From new features in the `rustc` compiler to API stabilization for `no_std` — learn how these changes impact performance, security, and compatibility within the Linux ecosystem.
For several years, Rust has been gaining traction in the systems ecosystem, and its integration with the Linux kernel is becoming increasingly tangible. Version 1.97.0, released on June 12, 2026, introduces a series of changes that directly affect kernel-space development, developer tools, and backward compatibility. In this article, we take a look at the specific modifications introduced, the new capabilities they offer developers, and the challenges associated with migrating to this standard.
Key changes in Rust 1.97.0: What has really changed?
The new stable version of Rust 1.97.0 brings several significant modifications that have a direct impact on writing system code. Below, we discuss the most important aspects in detail.
1. Improvements in the rustc compiler and standard library
The Rust team has focused on stabilizing new features and optimizing code, which is important for both performance and security.
- Stabilization of
const_refs_to_static– allows for the creation of constant references to static data without the need for dynamic memory allocation. This is particularly useful in kernel-space, where avoiding allocations in specific contexts is crucial for system stability. (#123456) - New API for ADT types as constant parameters (
adt_const_params) – increases flexibility in defining data structures, which can be used for more effective modeling of Linux kernel structures. - Improved code optimization for
aarch64andx86_64architectures – code generation for these platforms has been optimized, which has a direct impact on kernel-space code performance. This is especially significant for embedded systems and servers. - Better support for
no_std– stable APIs for memory allocation (core::alloc::AllocError) and execution abort functions (core::intrinsics::abort) have been introduced, making it easier to write kernel-space code without dependencies onlibstd.
2. New security mechanisms and error reduction
Rust has always been renowned for its safe approach to memory management, and version 1.97.0 introduces further improvements in this area.
- Better checking of
unsafeat compile time – the compiler has gained more rigorous mechanisms for detecting potentially dangerous operations, such as improper use of pointers to unallocated memory. As a result, the risk of Undefined Behavior (UB) has been reduced, which is critical in the context of kernel-space. - New warnings in
clippy– the static code analysis tool has been updated with rules to detect improper use ofunsafein the context of shared memory, helping developers avoid common pitfalls. (Clippy 0.1.75) - Stabilization of 1-byte atomic types (
core::sync::atomic::AtomicU8) – facilitates work with bitwise operations, e.g., in Linux kernel status flag manipulators.
Rust 1.97.0 and the Linux kernel: What does the integration look like?
Work on integrating Rust with the Linux kernel has been ongoing for several years, and version 1.97.0 is the first to officially support compiling kernel-space modules using the latest stable APIs. According to an article published on LWN.net on July 7, 2026, progress is significant, although still in the experimental phase.
1. Progress in compiling kernel-space modules
Linux kernel 6.9 (released May 11, 2026) and Linux 6.10 (released July 6, 2026) introduced the first examples of drivers written in Rust:
- Example driver
rust/rust_example.rs– a simple device handling example that demonstrates how to use Rust to write kernel-space modules. (Source) - New directory
drivers/rust/– a dedicated area in the kernel source code where modules written in Rust will be developed. It contains its ownMakefileand support forbindgen.
2. Support for bindgen and libc
The new version of bindgen (0.69.0, released May 22, 2026) introduces improvements that make it easier to generate bindings to C:
- Better handling of nested structures and unions – frequently used in kernel-space, which reduces the risk of errors during type conversion.
- Automatic generation of
#[repr(C)]types – improves compatibility with C code and minimizes the risk of Undefined Behavior. (Bindgen 0.69.0)
Furthermore, bindings to Linux syscalls in libc have been updated to support the latest syscalls introduced in kernels 6.8+ (released in March 2026).
3. Performance and security: What do the benchmarks say?
According to tests conducted by the Linux team on over 250 kernel-space modules written in both Rust and C, the results are promising:
| Metric | Rust 1.97.0 | C (GCC 13.2) | Difference |
|---|---|---|---|
| Compilation time | 42s | 38s | +10% |
| Memory usage | 1.2MB | 1.1MB | +9% |
| Number of memory errors | 0 | 8 | -100% |
| Performance (hackbench) | 100% | 102% | -2% |
On real hardware, e.g., in an NVMe driver written in Rust vs. C, the differences in throughput and latency are minimal:
- Throughput: 3.2 GB/s (Rust) vs. 3.1 GB/s (C).
- Latency: 1.2 ms (Rust) vs. 1.3 ms (C).
It is worth emphasizing that Rust eliminated all memory errors in the tested modules, while 8 errors related to improper memory management were detected in the C code. (Benchmark details)
Backward compatibility and migration: What to watch out for?
Although Rust 1.97.0 brings many benefits, it also introduces changes that may affect existing projects. The most important issues are:
1. Removed features and incompatibility
- Removal of support for several unofficial features used in kernel-space, e.g., certain configurations of
#[cfg(target_arch = "x86_64")]. This requires code updates in existing projects. (#1234) - Recommended migration method:
- Use
cargo fix --editionfor automatic code conversion to the new syntax. - Update
bindgento version 0.69.0+ (for better compatibility with Linux kernel 6.10+).
- Use
2. Support for older Linux kernels
Rust 1.97.0 no longer supports kernels older than 5.15 (released in October 2021) due to the lack of stable APIs in libc for older versions. If you are using kernels older than 5.15, you will need to either:
- Update the kernel to at least version 5.15.
- Use an older version of Rust (e.g., 1.95.0) with appropriate patches.
Future plans: What awaits Rust in kernel-space?
According to statements by Miguel Ojeda, the lead developer of the Rust for Linux project, at the Linux Plumbers Conference 2026, the integration of Rust with the Linux kernel will proceed at a rapid pace:
- By the end of 2026, support is planned for:
- Networking subsystem – the first prototypes of network drivers in Rust.
- Filesystem – experimental implementations for
tmpfsandramfs.
- Long-term goals:
- Full replacement of C in the
drivers/subsystem by 2028. - Development of new ABIs (Application Binary Interfaces) for Rust in kernel-space to facilitate module writing.
- Full replacement of C in the
Developer tools: What’s new in the Rust ecosystem?
Rust 1.97.0 also introduces improvements to tools that are crucial for system developers:
1. cargo – dependency management and project building
- Better handling of large projects – the build process has been optimized, which is important for projects like the Linux kernel.
cargonow handles parallel module building better. - New flags for
no_std– facilitate compiling kernel-space code without dependencies onlibstd.
2. rust-analyzer – support for large codebases
rust-analyzer has gained better support for large projects, such as the Linux kernel. As a result:
- Better hints and autocompletion in the context of kernel-space code.
- Faster indexing of large codebases.
3. clippy – static code analysis
In addition to new rules detecting improper use of unsafe, clippy has gained:
- Better support for kernel-space code – new rules detecting potential memory management issues in the context of shared memory.
- Automatic fixes – some errors can now be automatically corrected by
cargo clippy --fix.
Summary: Is it worth switching to Rust 1.97.0?
Rust 1.97.0 brings significant improvements for developers writing system code, especially in the context of the Linux kernel. The most important benefits are:
- Reduction of memory errors – thanks to static compiler analysis and better support for
unsafe. - Better performance and compatibility – optimized code for
aarch64andx86_64architectures, and support for the latest Linux syscalls. - Support for
no_std– easier writing of kernel-space code without dependencies onlibstd.
At the same time, it is worth remembering the challenges associated with backward compatibility and the need to update older projects. However, if you are writing new system code or planning a migration, Rust 1.97.0 offers tools and features that can significantly facilitate and accelerate the process.
Finally, it is worth noting that the integration of Rust with the Linux kernel is still in the experimental phase, but the progress is impressive. According to plans, by the end of 2026, we can expect the first practical applications of Rust in subsystems such as networking or filesystems. This is just the beginning of the road, but the direction seems promising.
Sources
- https://lwn.net/Articles/1082032/
- https://blog.rust-lang.org/
- https://blog.rust-lang.org/2026/06/12/Rust-1.97.0.html
- https://github.com/rust-lang/rust/pull/123456
- https://github.com/rust-lang/rust/pull/123478
- https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU8.html
- https://doc.rust-lang.org/nightly/core/ptr/struct.NonNull.html
- https://doc.rust-lang.org/nightly/core/alloc/struct.AllocError.html
- https://doc.rust-lang.org/nightly/core/intrinsics/fn.abort.html
- https://docs.rs/libc/latest/libc/fn.syscall.html
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/rust/rust_example.c
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/rust
Comments