You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we were willing to break backwards compatibility, it would be possible to support deriving Pod for arbitrary generic types.
The approach:
extend trait Pod to include const POST_MONOMORPHISM_CHECKS_PASS: bool;
the derive(Pod) instance puts its checks inside this POST_MONOMORPHISM_CHECKS_PASS constant. Since this is a trait member, it is allowed to reference the generic types.
(the backwards incompatible part) require that any function that uses T: Pod to do some form of safe transmute of T must first do assert!(POST_MONOMORPHISM_CHECKS_PASS);.
The text was updated successfully, but these errors were encountered:
If we were willing to break backwards compatibility, it would be possible to support deriving
Pod
for arbitrary generic types.The approach:
trait Pod
to includeconst POST_MONOMORPHISM_CHECKS_PASS: bool;
derive(Pod)
instance puts its checks inside thisPOST_MONOMORPHISM_CHECKS_PASS
constant. Since this is a trait member, it is allowed to reference the generic types.T: Pod
to do some form of safe transmute ofT
must first doassert!(POST_MONOMORPHISM_CHECKS_PASS);
.The text was updated successfully, but these errors were encountered: