-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
derive(Zeroable) on fieldful enums and repr(C) enums (#257)
* Add support for deriving Zeroable for fieldful enums if: 1. the enum is repr(Int), repr(C), or repr(C, Int), 2. the enum has a variant with discriminant 0, 3. and all fields of the variant with discriminant 0 are Zeroable. * Allow using derive(Zeroable) with explicit bounds. Update documentation and doctests. * doc update * doc update * remove unused * Factor out get_zero_variant helper function. * Use i128 to track disciminants instead of i64. * Add doc-comment for `get_fields` Co-authored-by: Daniel Henry-Mantilla <[email protected]> * Update derive/src/traits.rs Co-authored-by: Daniel Henry-Mantilla <[email protected]> --------- Co-authored-by: Daniel Henry-Mantilla <[email protected]>
- Loading branch information
1 parent
bb36879
commit a637e1d
Showing
3 changed files
with
290 additions
and
106 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
Oops, something went wrong.