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
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.
The text was updated successfully, but these errors were encountered:
joshlf
changed the title
Make #[derive(IntoBytes)] support a more generic types
Make #[derive(IntoBytes)] support more generic types
Nov 15, 2024
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 performconst
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 ofF: Unaligned<{derive_generated_computation}>
for that field.The text was updated successfully, but these errors were encountered: