Skip to content

Slightly improve diagnostic impl+output for uncovered type parameters#157677

Open
fmease wants to merge 2 commits into
rust-lang:mainfrom
fmease:orphanck-improv-diag
Open

Slightly improve diagnostic impl+output for uncovered type parameters#157677
fmease wants to merge 2 commits into
rust-lang:mainfrom
fmease:orphanck-improv-diag

Conversation

@fmease

@fmease fmease commented Jun 9, 2026

Copy link
Copy Markdown
Member

Split out of PR #135910. No behavioral changes.

See individual commit messages for details.

@rustbot

rustbot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

@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 Jun 9, 2026
@rustbot

rustbot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

r? @jackh726

rustbot has assigned @jackh726.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

@rust-log-analyzer

This comment was marked as outdated.

Comment thread compiler/rustc_hir_analysis/src/errors.rs Outdated
@fmease fmease force-pushed the orphanck-improv-diag branch from 8e9e9c8 to 4726555 Compare June 10, 2026 07:43
fmease added 2 commits June 10, 2026 09:43
Moreover, don't add the error code to the lint warning(!).
While helpful, it's quite unconventional.
The diagnostic is generally very noisy.
This commit tries to make it slightly less cluttered and more legible by

1. stopping to reuse the lengthy primary message as the primary label.
   This duplication didn't increase the information content and only
   turned the diagnostic into a letter and symbol soup.
   Instead, we now pick a succinct label ("uncovered type parameter")
   that immediately(!) signals to the users in red what is wrong with
   the highlighted type parameter.
2. breaking some information-dense notes into multiple lines.

Finally, this rephrases the slightly awkward and confusing
"type parameter […] must be used as a type parameter for […] type" to
"type parameter […] must be used as an argument to […] type".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants