logo
macro_rules! materialize {
    ( $ghost:expr $(,)? ) => { ... };
}
Available on ghostǃ only.
Expand description

Extract an imaginary T value out of a Ghost<T> phantom token.

Fake namespace

This macro does not really exist; it’s only available when inside a ghost! block.

use ::ghosts::vestibule::*;

fn wrap_in_some<T> (g: Ghost<T>)
 -> Ghost<Option<T>>
{
   ghost!({
       let it: T = materialize!(g);
       Some(it)
   })
}
  • (note that for this example, .map() could have been used instead)