logo
pub fn materialize<T>(_: Ghost<T>) -> T
Expand description

Ghost operation: extract an imaginary T value out of a Ghost<T> token.

THIS MUST ONLY BE USED FROM WITHIN A ghost! BLOCK

Or somewhere transitively called by a ghost! block exclusively.

Otherwise this call would try to make it to codegen, which it cannot do.

  • the current implementation uses a polymorphization limitation to prevent this, which works, but is not detected by cargo check.

Non-error-prone replacements