Rust plans to let types opt out of being moved or forgotten

Rust project goals: Immobile types and guaranteed destructors

Rust's 2026 roadmap includes a project to introduce new auto-traits, `Move` and `Forget`, that let types explicitly opt out of being relocated in memory or forgotten via `mem::forget`. This aims to simplify self-referential types, enable safe scoped spawn for async, and guarantee destructors run, addressing limitations of the current `Pin` mechanism. The project will be tested in the Linux kernel.

Rather than trying to change the language to make `Pin` work, we believe the problem is with `Pin` and we should improve the way immovable types are encoded in Rust instead.
  1. panstromek

    For everybody who doesn't have the context, just note that this is not an accepted langauge change. It's a just project goal, which means it's accepted as something people will work on, but the design might change significantly or it can even be abandoned completely (which is pretty unlikely for this one, to be fair).

  2. stymaar

    Great new! Since 2016 or so it became apparent that immovable types were a crucial missing part of Rust, but for a long time it was believed it wouldn't be possible to add them without breaking everything, which is why we ended up with the Pin hack.

    I'm very glad they found a way to add it eventually, as it's really filling a glaring hole in the language.

  3. yccs27

    There's a different proposal by @withoutboats to make immovability a property of the place/reference instead of the type:

    https://without.boats/blog/pinned-places/

    Does this project goal mean that the rust maintainers have decided to implement @yoshuawuyts' immovable types proposal in favor of pinned places?

  4. skitter

    Although not part of the goal, it also mentions `!Destruct`/"must-move types", aka linear types: Instead of there always being a way to drop values without providing any arguments, if you wanna get rid of a value of a linear type you have to call a function that takes it by value.

  5. dorjoy

    Does anyone know if there is any plan for no-panic to be a language feature? I think there was some discussion about this regarding Rust in the Linux kernel or embedded Rust but I don't know if there is any consensus or any plan regarding this.

  6. Tazerenix

    More algebraic effects being retrofitted onto Rust.

  7. OskarS

    mem::forget isn’t the only way you can safely leak a value, you can do it with reference cycles too, right? And there is no way for the compiler to detect that?

    Isn’t that why mem::forget is safe, because you can always implement it yourself safely? How do you get around that?

  8. groundzeros2015

    Guaranteed destructors is probably the most complex features ever added to C++, more than templates or move semantics.

More from this day

2026-08-03