Skip to content

Remove one remaining use of Level::Help - #162885

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
nnethercote:rm-Level-Help
Sep 18, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
nnethercote:rm-Level-Help

Conversation

@nnethercote

Copy link
Copy Markdown
Contributor

Unfortunately we can't yet get rid of Level::Help entirely because of proc_macro::Help. Details in individual commits.

r? @estebank

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.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 17, 2026
And remove `struct_help`, to discourage use of `Level::Help`.
(`Sublevel::Help` is fine.)
@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 31fafe3 has been approved by estebank

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Sep 17, 2026
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
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.)
@rust-bors
rust-bors Bot merged commit d2aced1 into rust-lang:main Sep 18, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
Rollup merge of #162885 - nnethercote:rm-Level-Help, r=estebank

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
@nnethercote
nnethercote deleted the rm-Level-Help branch September 18, 2026 05:38
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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants