Put ArchiveCopy
behind a feature
#119
Labels
language deficiency
Blocked on missing language or compiler features
Milestone
A major problem with
ArchiveCopy
types right now is that they may copy uninitialized bytes in their padding to the output. This behavior should be an opt-in feature for performance. There are still some types that can always be safely copied, so the trait needs to be split up.ArchiveCopy
needs to be split intoArchiveCopy
(auto trait, explicit impl until auto trait is stabilized, this can be copied but may have padding and produce uninitialized memory) andArchiveCopySafe
(explicit impl, this isArchiveCopy
and has no padding).Archive
the exact same way whether they'reArchiveCopy
or not. This includes performing field-by-field resolving even for types that areArchiveCopy
.ArchiveCopy
may implement the traits and no more.ArchiveCopySafe
types. They may also take advantage ofArchiveCopy
types, but only when a feature (copy_unsafe
?) is enabled.ArchiveCopySafe
impls when passed#[archive(copy_safe)]
.The text was updated successfully, but these errors were encountered: