Function lrs::intrinsics::forget

Moves an object without running its destructor.

Syntax

unsafe extern "rust-intrinsic" fn forget<T>(val: T) -> ()

Arguments

NameDescription
val

The object to be forgotten.

Remarks

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.

See also