Implement `Debug` (and maybe other traits that take `&(mut) self`) for `Unalign<T>` where `T: !Unaligned`
Open
compatibility-nonbreaking
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 179
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 29
Description
Use the technique described in https://github.com/google/zerocopy/issues/206, and maybe build on it if we add those methods.
One thing worth considering is whether it's acceptable to introduce the cost of copying `2 * size_of::()` bytes to trait impls that, for wrapper types, are supposed to just be passthroughs. Alternatively, we could just emit a simpler `Debug` impl that just prints the type's name but not its contents when `T: !Unaligned`.
Contributor guide
Assessment
This issue has not been assessed yet.