-
Notifications
You must be signed in to change notification settings - Fork 18
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
Derive on structs with generics #79
Open
kitlith
wants to merge
16
commits into
hecatia-elegua:main
Choose a base branch
from
kitlith:generic_derive
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+290
−101
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
503fa47
WIP: bitsize derive on generic structs
kitlith 8c44e5b
Potential fix for asserting bitsize on generic structs
kitlith 453f7d9
Potentially fix the rest of the derive macros for generic structs
kitlith f912e29
fixup! switch to uppercase to avoid warning
kitlith 9e1c541
Switch from bounding on field type to bounding on generics.
kitlith 123ee67
fixup! default impl needs to bound on default, not debug.
kitlith c3cc057
Pass where clause on struct through bitsize macros
kitlith 62441df
Use struct update syntax for ItemStruct
kitlith dd67083
Seperate phantom type generation into a function.
kitlith 5f501fe
Refactor where clause modification into shared function
kitlith 3071cf9
fixup! use unwrap_or_default()
kitlith d6e3b12
Rejigger the assert generation to match current idea
kitlith 3e489c5
Experimental: move assert generation into bitsize_internal
kitlith fa2c3d2
Gate FromBits and TryFromBits on Bitsized::BITS not panicing.
kitlith 853f418
fixup! s/T/Self/
kitlith d58ce82
Add test to check that where clauses are preserved by the derive macro
kitlith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading status checks…
Experimental: move assert generation into bitsize_internal
This allows me to make accesses to the consts on the Bitsize trait error. We could nix the Assertion trait here and just use the check expression directly.
commit 3e489c55c244e0b04c9902d27876367634108fca
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's clever! congratulations on finding this workaround!