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

derive: fix handling of generic bounds #178

Merged
merged 2 commits into from
Sep 28, 2020
Merged

Conversation

jonas-schievink
Copy link
Contributor

@jonas-schievink jonas-schievink commented Sep 22, 2020

This fixes bounds on generic parameters getting duplicated into the wrong place of the generated impl, which closes #176.

This also makes the custom derive emit bounds on type parameters instead of field types, since the latter can apparently run into very obscure and impossible to debug compiler bugs like rust-lang/rust#77052. This matches the behavior of Rust's built-in derives.

Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

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

LGTM. we should fix the docs that currently say we add bounds on field types.

@jonas-schievink jonas-schievink merged commit 3aa4e70 into main Sep 28, 2020
@jonas-schievink jonas-schievink deleted the generic-bounds-derive branch September 28, 2020 15:45
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.

proc-macro derive produced unparseable tokens
2 participants