Explore the concept of move constructors in Rust through this RustConf 2021 talk by Miguel Young de la Sota. Delve into the challenges of self-referential types, particularly async Futures, and their limitations in Rust. Learn how C++ handles safely-moveable self-referential types and discover a novel approach to bridging move constructors into Rust using Pin P guarantees. Understand how this technique can port all C++ constructors to Rust without compromising move-after-use protections, enabling return-by-move and collections support in stable Rust. Gain insights into the potential applications of this approach for zero-cost C++ FFI and expressing novel data structures in pure Rust. No prior C++ knowledge is required for this 24-minute presentation, which covers topics such as self-referential types, copy/move semantics, move-constructable types, macros, and future plans for this innovative concept.
Move Constructors in Rust: Possibilities and Applications