📝Rust lifetimes are not about object creation/destruction but about how long the object is available at the given location
- tags
This is one of the common Rust misconceptions. Rust lifetimes are not about object creation/destruction (lifetime?) but about how long the object is available at the given address.
The object might be moved out of its current location, but no destructors is called at this moment.
See also
Scope vs. Extent. Rust lifetimes represent extent.
Backlinks
- 📝 Scope vs. Extent
- 📝 Rust