Migrate rustc_attr crate diagnostics#100836
Merged
bors merged 9 commits intorust-lang:masterfrom Aug 27, 2022
Merged
Conversation
Contributor
|
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.
Contributor
Author
|
I think this PR is ready for review. There are a couple of FIXMEs in there I’d like some feedback on. |
Collaborator
|
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
Contributor
Author
|
r? rust-lang/diagnostics |
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
r=me after rebase |
dce52fb to
afd3476
Compare
Contributor
Author
|
Rebased! |
Member
|
@bors r+ |
Collaborator
Contributor
|
@bors rollup |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 27, 2022
…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
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Oct 23, 2023
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`
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 23, 2023
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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