logo

Keyword no_init

source · []
Available on ghostǃ only.
Expand description

Use #[no_init] inside a ghost! block to opt out of consuming ownership of outside captures.

use ::ghosts::vestibule::*;

let owned = String::from("…");
let casper = ghost!(#[no_init] {
   owned
});
drop(owned); // Ok