Urgent.News

600+ sources. One page. See who else covered it.

Editions

Tech

Rust Project Goals: Immobile types and guaranteed destructors

Abstract editorial illustration

The Rust programming language is set to introduce new traits that will clarify the operations possible on a type. Currently, Rust assumes all types can be moved and forgotten, but this proposal seeks to make these capabilities explicit. The concept of the Move and Forget traits will allow types to opt out of these operations, providing a more precise type system.

Historically, Rust has assumed that all values can be moved and forgotten without running destructors. However, some types, such as immobile types (e.g., certain self-referential async futures) and types requiring guaranteed destructors (e.g., scoped task handles), need to opt out of these capabilities. The current solution, Pin, introduces significant complexity when encoding immovability as a property of places rather than types.

The proposed Move trait will make the movability of a type explicit, ensuring that types implementing !Move cannot be moved and must maintain a stable address throughout their existence. This simplifies immovability as a type property, rather than a place property. Similarly, the Forget trait will let types opt out of being forgettable, enabling patterns like safe scoped spawn for async.

With !Forget, the destructor of a handle is guaranteed to run, preventing the task from accessing dangling references after the scope exits.

This initiative is an alternative to Project Goal 2025H2, which focuses on experimenting with Pin ergonomics. The Move and Forget traits will not resolve Pin's duplicate definition issue, but they will offer a different approach to encoding immovable types in Rust. The goal is to deprecate Pin entirely in the future, as Rust promises to remain backwards-compatible indefinitely. The Move proposal is intended as an alternative to Pin, aiming to improve the encoding of immovable types without altering the language itself.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Also reported by 1 other outlet

Read the original at github.com →

More in Tech

This Month in KDE Linux: July 2026

  • KDE Linux project integrates next-gen QA system for full-stack testing.
  • Kernel-hardening tweaks improve system security and software compatibility.
  • Documentation updates provide guides for new QA system and other configurations.

More from Monday 3 August →