-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize whether T: KnownLayout
requires T
's fields to be KnownLayout
#1162
Closed
3 tasks
Tracked by
#29
Labels
blocking-next-release
This issue should be resolved before we release on crates.io
Comments
34 tasks
In discussion with @joshlf, we decided to make the |
5 tasks
KnownLayout
requires T: KnownLayout
unnecessarilyT: KnownLayout
requires T
's fields to be KnownLayout
In a discussion with @jswrenn and @djkoloski, we decided:
|
jswrenn
added a commit
that referenced
this issue
Jul 1, 2024
We should not use `derive(KnownLayout)` on `Unalign`, because the derive is not smart enough to realize that `Unalign<T>` is always sized and thus emits a `KnownLayout` impl bounded on `T: KnownLayout.` This is overly restrictive. Fixes #1162
jswrenn
added a commit
that referenced
this issue
Jul 1, 2024
We should not use `derive(KnownLayout)` on `Unalign`, because the derive is not smart enough to realize that `Unalign<T>` is always sized and thus emits a `KnownLayout` impl bounded on `T: KnownLayout.` This is overly restrictive. Fixes #1162
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 1, 2024
We should not use `derive(KnownLayout)` on `Unalign`, because the derive is not smart enough to realize that `Unalign<T>` is always sized and thus emits a `KnownLayout` impl bounded on `T: KnownLayout.` This is overly restrictive. Fixes #1162
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Progress
KnownLayout for Unalign<T>
to requireT: KnownLayout
(add a test to confirm this behavior doesn't regress)feature = "derive"
- without aT: KnownLayout
bound) is to be forwards-compatible with supporting unsizedUnalign
(#209)impl_or_verify!
to supportKnownLayout
- theUnalign
bounds issue wasn't caught because, forKnownLayout
, we useimpl_known_layout!
rather thanimpl_or_verify!
T: KnownLayout
never requires its fields to beKnownLayout
Details
Relates to #29.
Consider the following code:
Since
T
has an implicitT: Sized
bound, our emitted derive should not require thatT: KnownLayout
, but it does. This is currently affectingUnalign
, resulting in it having a different bound when compiling withfeature = "derive"
(namely,T: KnownLayout
) than when compiling withoutfeature = "derive"
.The text was updated successfully, but these errors were encountered: