Moves an object without running its destructor.
unsafe extern "rust-intrinsic" fn forget<T>(val: T) -> ()
| Name | Description |
|---|---|
| val | The object to be forgotten. |
The object will be moved into the forget function which will return without running the object's destructor. This is unsafe because it can cause objects whose destructor must run at the end of their lifetime to not be destroyed.
You probably want to use the safe variant lrs::mem::forget.