Make `#[derive(IntoBytes)]` support more generic types
Open
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 179
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 29
Description
Here's an idea for making `#[derive(IntoBytes)]` smarter on generic types: we can see from the surface syntax which fields are based on generic types and which are entirely concrete. Then, we can perform `const` computation based on those concrete types to extract *partial* information about the type. We can then use that partial information to infer bounds that must hold of generic types.
For example, if we could use `const` code to compute the maximum alignment that we could tolerate for a given field, then we could emit a bound of `F: Unaligned<{derive_generated_computation}>` for that field.
Contributor guide
Assessment
This issue has not been assessed yet.