Skip to content

Make TypeFoldable derivable #65674

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

Closed
Aaron1011 opened this issue Oct 21, 2019 · 3 comments · Fixed by #66384
Closed

Make TypeFoldable derivable #65674

Aaron1011 opened this issue Oct 21, 2019 · 3 comments · Fixed by #66384
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Aaron1011
Copy link
Member

Currently, the (internal) TypeFoldable trait must be implemented via the fairly verbose EnumTypeFoldableImpl! and BraceStructTypeFoldableImpl! macros. Adding a derive(TypeFoldable) proc-macro to librustc_macros would allow us to delete a large amount of code, and would drastically simplify adding new TypeFoldable implementations.

@jonas-schievink jonas-schievink added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 21, 2019
@cjgillot
Copy link
Contributor

Hello,
I would like to do that.
Do you mind?

@Aaron1011
Copy link
Member Author

@cjgillot: Go ahead :)

@eddyb
Copy link
Member

eddyb commented Nov 13, 2019

Technically a subset of / related to #36588 - although I think I went a bit crazy with the ideas there, and just regular derives for a lot of traits is fine.

@bors bors closed this as completed in d801458 Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants