Remove one remaining use of Level::Help - #162885
Merged
Merged
Conversation
Borrow checking produces some weird, spanless help messages about fixing lifetime errors. If there are multiple, they are grouped under a header like this: ``` help: the following changes may resolve your lifetime errors ``` There are three forms of these. One of the forms is this: ``` = help: add bound `'a: 'b` ``` This form is redundant, because there is always an earlier help note (on a proper error message with a span) like this: ``` = help: consider adding the following bound: `'b: 'a` ``` This commit removes these redundant messages.
…ostic It's currently a spanless top-level help diagnostic. This commit changes it to an error (with one or more help subdiagnostics), gives it a span, and changes the wording. Note that giving it a span means that deduplication will no longer erroneously hide diagnostics with identical wording from different functions! Because of this, several "duplicate diagnostic" mentions are removed from the expected outputs. It's still a weird diagnostic (and now counts towards the error count) but it's better than before. This also removes the one use of buffered non-error diagnostics. So `BufferedDiag` is also removed.
And remove `struct_help`, to discourage use of `Level::Help`. (`Sublevel::Help` is fine.)
nnethercote
force-pushed
the
rm-Level-Help
branch
from
September 17, 2026 06:53
c329a5e to
31fafe3
Compare
Contributor
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 17, 2026
Remove one remaining use of `Level::Help` Unfortunately we can't yet get rid of `Level::Help` entirely because of `proc_macro::Help`. Details in individual commits. r? @estebank
This was referenced Sep 17, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 18, 2026
…uwer Rollup of 10 pull requests Successful merges: - #161987 (fix `is_single_fp_element` for `s390x` and `x86`) - #162366 (Replace hard linked `metadata.rmeta` with a copy when finalizing the incremental compilation session dir fails) - #162552 (RISC-V: Add Zmmul target feature) - #162602 (Ensure concurrent rustc instances in the same process correctly lock the session dir) - #162885 (Remove one remaining use of `Level::Help`) - #162606 (c-b: Export `fmaf16` now that we have an implementation) - #162817 (rustc_{codegen_,}llvm: adapt to new ThreadModel API) - #162860 (offload: add libLLVM rpath for libomptarget) - #162895 (Avoid derive edits on macro-generated types) - #162899 (Error on invalid placements of the `cfi_encoding` attribute.)
pull Bot
pushed a commit
to xtqqczze/rust-lang-rust-analyzer
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#161987 (fix `is_single_fp_element` for `s390x` and `x86`) - rust-lang/rust#162366 (Replace hard linked `metadata.rmeta` with a copy when finalizing the incremental compilation session dir fails) - rust-lang/rust#162552 (RISC-V: Add Zmmul target feature) - rust-lang/rust#162602 (Ensure concurrent rustc instances in the same process correctly lock the session dir) - rust-lang/rust#162885 (Remove one remaining use of `Level::Help`) - rust-lang/rust#162606 (c-b: Export `fmaf16` now that we have an implementation) - rust-lang/rust#162817 (rustc_{codegen_,}llvm: adapt to new ThreadModel API) - rust-lang/rust#162860 (offload: add libLLVM rpath for libomptarget) - rust-lang/rust#162895 (Avoid derive edits on macro-generated types) - rust-lang/rust#162899 (Error on invalid placements of the `cfi_encoding` attribute.)
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.
Unfortunately we can't yet get rid of
Level::Helpentirely because ofproc_macro::Help. Details in individual commits.r? @estebank