-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Migrate rustc_attr
crate diagnostics
#100836
Migrate rustc_attr
crate diagnostics
#100836
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
63f1b6a
to
26b6c31
Compare
This comment has been minimized.
This comment has been minimized.
I think this PR is ready for review. There are a couple of FIXMEs in there I’d like some feedback on. |
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
r? rust-lang/diagnostics |
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
r=me after rebase |
dce52fb
to
afd3476
Compare
Rebased! |
@bors r+ |
@bors rollup |
…mpiler-errors Rollup of 9 pull requests Successful merges: - rust-lang#100724 (Migrate ast lowering to session diagnostic) - rust-lang#100735 (Migrate `rustc_ty_utils` to `SessionDiagnostic`) - rust-lang#100738 (Diagnostics migr const eval) - rust-lang#100744 (Migrate rustc_mir_dataflow to diagnostic structs) - rust-lang#100776 (Migrate `rustc_lint` errors to `SessionDiagnostic`) - rust-lang#100817 (sugg: suggest the usage of boolean value when there is a typo in the keyword) - rust-lang#100836 (Migrate `rustc_attr` crate diagnostics) - rust-lang#100890 (Migrate rustc_driver to SessionDiagnostic) - rust-lang#100900 (on `region_errors.rs`) Failed merges: - rust-lang#100831 (Migrate `symbol_mangling` module to new diagnostics structs) r? `@ghost` `@rustbot` modify labels: rollup
Eliminate rustc_attrs::builtin::handle_errors in favor of emitting errors directly Suggested in rust-lang#116773 (review). This `handle_errors` function is originally from rust-lang#34531, in which it was useful because it allowed error messages and error codes (`E0542`) for multiple occurrences of the same error to be centralized in one place. For example rather than repeating this diagnostic in 2 places: ```rust span_err!(diagnostic, attr.span, E0542, "missing 'since'"); ``` one could repeat this instead: ```rust handle_errors(diagnostic, attr.span, AttrError::MissingSince); ``` ensuring that all "missing 'since'" errors always remained consistent in message and error code. Over time as error messages and error codes got factored to fluent diagnostics (rust-lang#100836), this rationale no longer applies. The new code has the same benefit while being less verbose (+73, -128). ```rust sess.emit_err(session_diagnostics::MissingSince { span: attr.span }); ``` r? `@cjgillot`
Rollup merge of rust-lang#117064 - dtolnay:handleerrors, r=cjgillot Eliminate rustc_attrs::builtin::handle_errors in favor of emitting errors directly Suggested in rust-lang#116773 (review). This `handle_errors` function is originally from rust-lang#34531, in which it was useful because it allowed error messages and error codes (`E0542`) for multiple occurrences of the same error to be centralized in one place. For example rather than repeating this diagnostic in 2 places: ```rust span_err!(diagnostic, attr.span, E0542, "missing 'since'"); ``` one could repeat this instead: ```rust handle_errors(diagnostic, attr.span, AttrError::MissingSince); ``` ensuring that all "missing 'since'" errors always remained consistent in message and error code. Over time as error messages and error codes got factored to fluent diagnostics (rust-lang#100836), this rationale no longer applies. The new code has the same benefit while being less verbose (+73, -128). ```rust sess.emit_err(session_diagnostics::MissingSince { span: attr.span }); ``` r? `@cjgillot`
Hi!
This is my first PR to the rustc project, excited to be part of the development! This PR is part of the diagnostics effort, to make diagnostics translatable.
@rustbot label +A-translation