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

Properly deal with generic bounds in codegen #125

Merged
merged 3 commits into from
Jul 18, 2022
Merged

Conversation

sagacity
Copy link
Contributor

@sagacity sagacity commented Jul 6, 2022

This solves the issue mentioned in #88 where trait bounds were incorrectly suffixed with : Serializable even if that bound was already present. Additionally, it allows the use of other bounds whereas previously any additional bounds would cause collect_types to be invoked incorrectly.

@sagacity sagacity requested a review from a team as a code owner July 6, 2022 13:39
@sagacity sagacity force-pushed the serializable-bounds branch from beb1cb9 to 421d997 Compare July 6, 2022 13:52
// Ignore other bound types (lifetimes) for now
_ => true,
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would have used partition() for filtering the bounds, and then applied the side-effects to the extracted bounds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good tip, I don't think I was even aware of partition. Would have worked well here, indeed.

@sagacity sagacity merged commit 7fa8e0b into main Jul 18, 2022
@sagacity sagacity deleted the serializable-bounds branch July 18, 2022 08:23
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.

2 participants