-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 some of rustc_passes::check_attr
's diagnostics and derive improvements
#99213
Merged
Conversation
This file contains 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
rustbot
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jul 13, 2022
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jul 13, 2022
This comment was marked as resolved.
This comment was marked as resolved.
compiler-errors
approved these changes
Jul 14, 2022
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.
These changes look fine. I would maybe like context on the questions I asked but otherwise r=me with changes or not.
davidtwco
force-pushed
the
translation-migrate-passes
branch
from
July 14, 2022 13:50
98362e3
to
505e7e7
Compare
@bors r=compiler-errors |
📌 Commit 505e7e7d94b3a168dad1c614cc2dfea76460b87a has been approved by It is now in the queue for this repository. |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jul 14, 2022
This comment was marked as resolved.
This comment was marked as resolved.
bors
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Jul 15, 2022
Implements `IntoDiagnosticArg` for `char` using its `Debug` implementation and introduces a macro for those types which just delegate the implementation to `ToString`. Signed-off-by: David Wood <david.wood@huawei.com>
Apply the `#[rustc_lint_diagnostics]` attribute to `LintDiagnosticBuilder::build` so that diagnostic migration lints will trigger for it. Signed-off-by: David Wood <david.wood@huawei.com>
Add support for `MultiSpan` with any of the attributes that work on a `Span` - requires that diagnostic logic generated for these attributes are emitted in the by-move block rather than the by-ref block that they would normally have been generated in. Signed-off-by: David Wood <david.wood@huawei.com>
Both diagnostic and subdiagnostic derives were missing the ability to add warnings to diagnostics - this is made more difficult by the `warn` attribute already existing, so this name being unavailable for the derives to use. `#[warn_]` is used instead, which requires special-casing so that `{span_,}warn` is called instead of `{span_,}warn_`. Signed-off-by: David Wood <david.wood@huawei.com>
Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable.
davidtwco
force-pushed
the
translation-migrate-passes
branch
from
July 15, 2022 15:31
505e7e7
to
78b19a9
Compare
@bors r+ |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Jul 15, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 16, 2022
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#98582 (Allow destructuring opaque types in their defining scopes) - rust-lang#99213 (migrate some of `rustc_passes::check_attr`'s diagnostics and derive improvements) - rust-lang#99258 (Provide structured suggestion for dropped temp value) - rust-lang#99259 (interpret/visitor: support visiting with a PlaceTy) - rust-lang#99287 ([rustdoc-json] JSON no longer inlines) - rust-lang#99290 (Revert "Highlight conflicting param-env candidates") - rust-lang#99316 (docs: add missing word) - rust-lang#99317 (Borrow Vec<T, A> as [T]) - rust-lang#99323 (Fix flakyness of GUI tests) - rust-lang#99342 (Avoid some `Symbol` to `String` conversions) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jul 27, 2022
…s-2, r=compiler-errors passes: port more of `check_attr` module Continues from rust-lang#99213. Port more diagnostics in `rustc_passes::check_attr` to using the diagnostic derive and translation machinery. r? `@compiler-errors`
compiler-errors
added
the
A-translation
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
label
Aug 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-translation
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
IntoDiagnosticArg
forchar
using itsDebug
implementation and introduces a macro for those types which just delegate the implementation toToString
.#[rustc_lint_diagnostics]
attribute toLintDiagnosticBuilder::build
so that diagnostic migration lints will trigger for it - some diagnostics inrustc_privacy
need updated after this since the lints apply to that crate.MultiSpan
with any of the attributes that work on aSpan
in the diagnostic derive (SessionDiagnostic
+LintDiagnostic
). Requires that diagnostic logic generated for these attributes are emitted in the by-move block rather than the by-ref block that they would normally have been generated in.warn
attribute already existing, so this name being unavailable for the derives to use.#[warn_]
is used instead, which requires special-casing so that{span_,}warn
is called instead of{span_,}warn_
.rustc_passes::check_attr
diagnostics to using diagnostic derives and being translatable. I got tired after a while. I modified some diagnostic output for consistency while doing this, nothing too crazy.r? @compiler-errors