HeadlinesBriefing favicon HeadlinesBriefing.com

Rust Move Trait: Enabling Immobile Types and Guaranteed Destructors

Hacker News •
×

The Rust project proposes introducing Move and Forget traits to allow types to opt out of being moved or forgotten. This enables scoped spawn, async drop, and pin-by-default patterns. The initiative, tracked under [#635], involves compiler implementation and Linux kernel validation.

Champions @lcnr and @jackh726 lead the effort for 2026-2027. Currently, Rust assumes all values can be moved and forgotten, but some types need stable addresses or guaranteed destructors. The Move trait encodes immovability as a type property rather than a place property, simplifying self-referential types.

The ! Forget trait ensures destructors run, enabling safe scoped spawn for async. Work includes compiler implementation, RFCs, and testing in real-world scenarios like the Linux kernel.