Skip to content
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

Fix soundness issue of TransparentWrapper derive macro. #173

Merged

Conversation

zachs18
Copy link
Contributor

@zachs18 zachs18 commented Feb 15, 2023

May resolve #170.

Uses the compiler to check that all non-wrapped fields are actually 1-ZSTs, and uses Zeroable to check that all non-wrapped fields are "conjurable" (See discussion in the linked issue).

Additionally, relaxes the bound of impl<T: Zeroable> Zeroable for PhantomData<T> to all T: ?Sized.

Uses the compiler to check that all non-wrapped fields are actually 1-ZSTs,
and uses Zeroable to check that all non-wrapped fields are "conjurable".

Additionally, relaxes the bound of `PhantomData<T: Zeroable>: Zeroable` to all `T: ?Sized`.
@Lokathor Lokathor merged commit 1039388 into Lokathor:main Feb 17, 2023
@Lokathor Lokathor added semver-patch semver patch change semver-derive We need to update the main crate's use of the derive crate labels Feb 17, 2023
leod pushed a commit to leod/bytemuck that referenced this pull request Jun 3, 2023
Uses the compiler to check that all non-wrapped fields are actually 1-ZSTs,
and uses Zeroable to check that all non-wrapped fields are "conjurable".

Additionally, relaxes the bound of `PhantomData<T: Zeroable>: Zeroable` to all `T: ?Sized`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-derive We need to update the main crate's use of the derive crate semver-patch semver patch change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TransparentWrapper derive unsoundness
2 participants