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(macros): enumerate after filtering #288

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

cAttte
Copy link
Contributor

@cAttte cAttte commented Nov 3, 2024

this fixes #287. it just swaps the order of operations to filtering out non-type generic params, then enumerating them, within specta_macros' parse_struct() and parse_enum(). this affects no other parts of the codebase because the output of this operation is only ever (directly or indirectly) consumed in places where filter-then-enumerate is semantically correct (struct: 1, 2, 3, 4, enum: 1, 2) or passed to generics::construct_datatype() (struct: 1, 2, 3, enum: 1, 2), which then only ever passes it recursively to itself (1, 2, 3, 4, 5), or uses it in a way that is semantically correct (1). very good!

@oscartbeaumont oscartbeaumont merged commit 03b4e9a into specta-rs:main Nov 4, 2024
1 of 4 checks passed
@oscartbeaumont
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic structs with lifetime specifiers don't work
2 participants