Improve diagnostic-related lints: untranslatable_diagnostic
& diagnostic_outside_of_impl
by GrigorenkoPV · Pull Request #128941 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation3 Commits3 Checks6 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
Summary:
- Made
untranslatable_diagnostic
point to problematic arguments instead of the function call
(I found this misleading while working on someA-translation
PRs: my first impression was that
the methods themselves were not translation-aware and needed to be changed,
while in reality the problem was with the hardcoded strings passed as arguments). - Made the shared pass of
untranslatable_diagnostic
&diagnostic_outside_of_impl
more efficient.
@rustbot label D-imprecise-spans A-translation
and not the function/method call
- Decouple them.
- Make logic around
diagnostic_outside_of_impl
's early exits simpler. - Make
untranslatable_diagnostic
run one loop instead of two and not allocate an intermediate vec. - Overall, reduce the amount of code executed when the lints do not end up firing.
r? @davidtwco
rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r?
to explicitly pick a reviewer
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
Diagnostics: spans don't point to exactly the erroneous code
labels
📌 Commit e94a4ee has been approved by davidtwco
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
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#127279 (use old ctx if has same expand environment during decode span)
- rust-lang#127945 (Implement
debug_more_non_exhaustive
) - rust-lang#128941 ( Improve diagnostic-related lints:
untranslatable_diagnostic
&diagnostic_outside_of_impl
) - rust-lang#129070 (Point at explicit
'static
obligations on a trait) - rust-lang#129187 (bootstrap: fix clean's remove_dir_all implementation)
- rust-lang#129231 (improve submodule updates)
- rust-lang#129264 (Update
library/Cargo.toml
in weekly job) - rust-lang#129284 (rustdoc: animate the
:target
highlight) - rust-lang#129302 (compiletest: use
std::fs::remove_dir_all
now that it is available)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#127279 (use old ctx if has same expand environment during decode span)
- rust-lang#127945 (Implement
debug_more_non_exhaustive
) - rust-lang#128941 ( Improve diagnostic-related lints:
untranslatable_diagnostic
&diagnostic_outside_of_impl
) - rust-lang#129070 (Point at explicit
'static
obligations on a trait) - rust-lang#129187 (bootstrap: fix clean's remove_dir_all implementation)
- rust-lang#129231 (improve submodule updates)
- rust-lang#129264 (Update
library/Cargo.toml
in weekly job) - rust-lang#129284 (rustdoc: animate the
:target
highlight) - rust-lang#129302 (compiletest: use
std::fs::remove_dir_all
now that it is available)
r? @ghost
@rustbot
modify labels: rollup
jieyouxu added a commit to jieyouxu/rust that referenced this pull request
…ints, r=davidtwco
Improve diagnostic-related lints: untranslatable_diagnostic
& diagnostic_outside_of_impl
Summary:
- Made
untranslatable_diagnostic
point to problematic arguments instead of the function call (I found this misleading while working on someA-translation
PRs: my first impression was that the methods themselves were not translation-aware and needed to be changed, while in reality the problem was with the hardcoded strings passed as arguments). - Made the shared pass of
untranslatable_diagnostic
&diagnostic_outside_of_impl
more efficient.
@rustbot
label D-imprecise-spans A-translation
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#127279 (use old ctx if has same expand environment during decode span)
- rust-lang#127945 (Implement
debug_more_non_exhaustive
) - rust-lang#128941 ( Improve diagnostic-related lints:
untranslatable_diagnostic
&diagnostic_outside_of_impl
) - rust-lang#129070 (Point at explicit
'static
obligations on a trait) - rust-lang#129187 (bootstrap: fix clean's remove_dir_all implementation)
- rust-lang#129231 (improve submodule updates)
- rust-lang#129264 (Update
library/Cargo.toml
in weekly job) - rust-lang#129284 (rustdoc: animate the
:target
highlight) - rust-lang#129302 (compiletest: use
std::fs::remove_dir_all
now that it is available)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#128941 - GrigorenkoPV:internal-diagnostic-lints, r=davidtwco
Improve diagnostic-related lints: untranslatable_diagnostic
& diagnostic_outside_of_impl
Summary:
- Made
untranslatable_diagnostic
point to problematic arguments instead of the function call (I found this misleading while working on someA-translation
PRs: my first impression was that the methods themselves were not translation-aware and needed to be changed, while in reality the problem was with the hardcoded strings passed as arguments). - Made the shared pass of
untranslatable_diagnostic
&diagnostic_outside_of_impl
more efficient.
@rustbot
label D-imprecise-spans A-translation
Labels
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
Diagnostics: spans don't point to exactly the erroneous code
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.