const_transmute

Function const_transmute 

Source
pub const unsafe fn const_transmute<T, U>(value: T) -> U
Expand description

Transmute for const contexts.

This transmute bypasses basically all restrictions on the normal core::mem::transmute. As such, this function is extremely unsafe to use. It is only used because we can’t use traits in const expressions to get the internals if associated types.

§Safety

T must be transmutable to U. This means U must be the same layout as T or contained in the layout of T.