Function lrs::intrinsics::move_val_init

Stores a new value in an object without running the object's destructor.

Syntax

unsafe extern "rust-intrinsic" fn move_val_init<T>(dst: *mut T, src: T) -> ()

Arguments

NameDescription
dst

The location where src will be stored.

src

The value to store in dst.

Remarks

This can be used to initialize memory that was previously created with uninit.

Examples

unsafe fn f(x: T) {
    let mut y = uninit():
    move_val_init(&mut y, x);
}

See also