Skip to main content

erase_val

Function erase_val 

Source
pub fn erase_val<T: Erasable>(value: T) -> Erased<T>
Expand description

Erases a value of type T into Erased<T>.

Erased<T> and Erased<U> are type-checked as distinct types, but codegen can see whether they actually have the same storage type.

FIXME: This might have soundness issues with erasable types that don’t implement the same auto-traits as [u8; _]; see https://github.com/rust-lang/rust/pull/151715#discussion_r2740113250