Is there any hope for a new supertrait of
Copythat means "safe to put in a union, and safe to transmute to an array of bytes, but cannot be implicitly copied?" I have stuff I want to put into unions that are semantically move-only (use-once) resources, and also I need the byte transmute transform and would prefer to be able to have the same restriction (bitwise movable but not implicitly copyable).
My understanding from the
DynSized discussion is that it's very hard to add such types, but the definition of
union doesn't make sense without it. In particular,
union requires too much use of
unsafe; at least all the uses I have for it are completely safe w.r.t. what
unsafe is trying to accomplish.
I don't follow. What would be examples of types that do not have this property?