Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rust for Linux in stable: language features

Metadata
Point of contactTomas Sedovic
StatusProposed
Tracking issuerust-lang/rust-project-goals#116
Zulip channel#rust-for-linux
Stabilizationtrue
lang championJosh Triplett
lang-docs championTC
Teamslang, lang-docs, libs
Task owners(none)

Summary

Continue working towards Rust for Linux on stable. In particular, this goal is focused on the language features.

Motivation

Getting the Linux kernel to build with stable Rust and, more generally, supporting the needs of the Linux kernel to make Rust a success there, has been a priority for the Rust project and a previous flagship goal: 2024H2, 2025H1.

One of the key areas are language features, given the impact they could have on the kernel if they were to change, especially those that may require changes on potentially many source files and/or that may not be easy to workaround with conditional compilation.

The ultimate goal is for the Linux kernel to build on stable Rust, not requiring any unstable features. This is very likely going to take more than one year.

In the meantime, any progress on any feature (or an alternative to using a given unstable feature) is welcome. In particular, finishing the work around arbitrary_self_types and derive_coerce_pointee and stabilizing them would be considered a major success.

An important design axiom that still applies from previous iterations is “Don’t let perfect be the enemy of good”. The primary goal is to offer stable support for the particular use cases that the Linux kernel requires. Wherever possible we aim to stabilize features completely, but if necessary, we can try to stabilize a subset of functionality that meets the kernel developers’ needs while leaving other aspects unstable.

The status quo

The Linux kernel relies or plans to rely on the following features:

We also depend on the following goals (some of which spun out of the broad Rust for Linux effort):

As well as a set of compiler flags and other features which have their own project goal.

Work items over the next year

TaskOwner(s)Notes
Deref/Receiver Implementation & docsDing Xiang Fei
Deref/Receiver Reference PRDing Xiang Fei
Deref/Receiver Stabilization PRDing Xiang Fei
arbitrary_self_types Implementation & docsDing Xiang Fei
arbitrary_self_types Reference PRDing Xiang Fei
arbitrary_self_types Stabilization PRDing Xiang Fei
derive(CoercePointee) Implementation & docsDing Xiang Fei
derive(CoercePointee) Reference PRDing Xiang Fei
derive(CoercePointee) Stabilization PRDing Xiang Fei
asm_const_ptr Implementation & docsAlice Ryhl
asm_const_ptr Reference PR
asm_const_ptr Style and rustfmt
asm_const_ptr Stabilization PR
cfg(no_fp_fmt_parse) Reference PR ??
cfg(no_fp_fmt_parse) Stabilization PR
used_with_arg Implementation & docs
used_with_arg Stabilization PR

Team asks

TeamSupport levelNotes
langMediumReviews, Lang/RfL meetings
lang-docsMediumReviews, Lang/RfL meetings
libsSmallReviews