A proposal to extend Rust's type system with a trait hierarchy (Forget, Destruct, Move, Pointee) that enables different kinds of destructors and guarantees cleanup. This would enable async drop, prevent value leaking, support async scoped tasks, and allow destructors with arguments. The proposal introduces new default trait bounds using an opt-in scheme similar to RFC #3729, where generic parameters default to Forget but can opt into weaker bounds. The borrow checker would enforce these bounds, requiring Destruct for dropped values and Move for moved values. This addresses fundamental limitations in Rust's current destructor model while maintaining backwards compatibility.

Table of contents
SummaryMotivationSo what can we do about it?Impact of these boundsFrequently asked questions1 Comment
Sort: