Improve `#[derive(IntoBytes)]` padding analysis on DSTs
Open
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 179
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 29
Description
Many dynamically sized types can be `derive(FromBytes)` but not `derive(IntoBytes)` because of shortcomings in our padding analysis. For example:
```rust
#[derive(KnownLayout, FromBytes, IntoBytes)]
#[repr(C)]
struct Example {
header: Header,
body: [Body],
}
```
Presently, a user must either mark `Example` as `repr(C, packed)`, or they must model `Example` instead as a composite struct containing `Ref`s to the `Header` and `[Body]`.
Can we make our analysis more sophisticated in this case?
Contributor guide
Assessment
This issue has not been assessed yet.