5–7 Oct 2026
Europe/Prague timezone

Leveraging Rust's Field Projections in the Kernel and Beyond

Not scheduled
45m
Kernel Summit Track Kernel Summit Track

Speaker

Benno Lossin

Description

Several Rust contributors and I have been collaborating on a novel language feature called "Field Projections". The feature is still being designed and implemented, so now is a good opportunity to experiment with it to see what new APIs it unlocks for the Kernel and other projects. We also want to investigate any gaps in our current design that prevent important use-cases from being supported.

Rust makes heavy use of custom pointers filling the gap (& going beyond) between references (&T and &mut T) and raw pointers (*const T and *mut T). Currently, they have two major issues: ergonomics and feature parity with builtin references and Box<T>. Raw pointers and their extensions (e.g. NonNull<T>) have especially bad ergonomics. Our Field Projection language feature aims to remedy these shortcomings of custom (dumb & smart) pointers; our current approach is an ambitious generalization of Deref that supports a plethora of custom pointers from MyBox<T> (that has all the properties of Box<T>) to VolatilePtr<T> (which is only using {read,write}_volatile to access the pointee). Our proposal integrates tightly with existing features such as place expressions, operations on places, the borrow-checker, and autoref.

Author

Presentation materials

There are no materials yet.