transmute
has two restrictions I'm not sure you have added here:
- Input and output size must be identical.
- Input and output size must be statically known before monomorphization so eg
transmute::<T, U>
is not allowed, but eg transmute::<PhantomData<T>, PhantomData<U>>
is allowed. Note that types like [T; 0]
are not considered to be of a fixed size for the purpose of this check.
Originally posted by @bjorn3 in #1194 (comment)