The post discusses an attempt to create linear types in Rust that can only be used exactly once using a struct called UseOnce<T>. It explains the implementation details, including destructive move semantics and the use of MaybeUninit<T>. The post also highlights some limitations and issues, such as the potential to exfiltrate the inner value and reliance on the compiler's behavior without optimizations, which make the approach less practical.

5m read timeFrom geo-ant.github.io
Post cover image
Table of contents
ImplementationWhy It’s CursedEndnotes✨ Support

Sort: