-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unsoundness in impl_for_transparent_wrapper!
Previously, `impl_for_transparent_wrapper!` permitted the following unsound code to compile: impl_for_transparent_wrapper!(FromBytes for AtomicBool); `impl_for_transparent_wrapper!` attempted to ensure that `AtomicBool`'s inner type implemented `FromBytes`, but failed to properly enforce this bound (it should have failed thanks to `bool: !FromBytes`). This commit simplifies `impl_for_transparent_wrapper!` and fixes this soundness hole. This fix is adapted from @josephlr's similar fix in #1091. Credit to @josephlr for discovering this soundness hole. Co-authored-by: Joe Richey <[email protected]>
- Loading branch information
Showing
2 changed files
with
111 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters