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

rustc: Migrate __register_diagnostic and friends to stable proc macros #64132

Closed
petrochenkov opened this issue Sep 3, 2019 · 2 comments · Fixed by #64139
Closed

rustc: Migrate __register_diagnostic and friends to stable proc macros #64132

petrochenkov opened this issue Sep 3, 2019 · 2 comments · Fixed by #64139
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) 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

@petrochenkov
Copy link
Contributor

A few macros used internally in rustc for working with error codes still use legacy proc macros (aka syntactic plugins) making rustc one of the last (the last?) noticeable users of the feature in the ecosystem.

They need to be moved to librustc_macros and re-implemented using the stable proc macro API.
Currently they are registered in librustc_interface/passes.rs - __diagnostic_used, __register_diagnostic and __build_diagnostic_array.

(If they can be rewritten as declarative macros, that would be even better.)

@petrochenkov petrochenkov added C-cleanup Category: PRs that clean code up or issues documenting cleanup. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-diagnostics Area: Messages for errors, warnings, and lints labels Sep 3, 2019
@petrochenkov
Copy link
Contributor Author

cc @GuillaumeGomez @estebank
(I'm not sure who is responsible for the error index now.)

@Mark-Simulacrum
Copy link
Member

Assigning to self as I've recently done some work here so should be able to knock this out fairly easily.

@Mark-Simulacrum Mark-Simulacrum self-assigned this Sep 3, 2019
@estebank estebank added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 3, 2019
@bors bors closed this as completed in 89a69fd Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) 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.

3 participants