Skip to content

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

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
fmease:orphanck-improv-diag
Jun 14, 2026
Merged

Slightly improve diagnostic impl+output for uncovered type parameters#157677
rust-bors[bot] merged 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
@rust-bors

This comment has been minimized.

@jackh726

Copy link
Copy Markdown
Member

r=me after rebase

@fmease fmease force-pushed the orphanck-improv-diag branch from 4726555 to 2fda233 Compare June 14, 2026 09:44
@rustbot

rustbot commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

fmease added 2 commits June 14, 2026 11:44
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".
@fmease

fmease commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

@bors r=jackh726 rollup

@rust-bors

rust-bors Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2fda233 has been approved by jackh726

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 Jun 14, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 14, 2026
…kh726

Slightly improve diagnostic impl+output for uncovered type parameters

Split out of PR rust-lang#135910. No behavioral changes.

See individual commit messages for details.
rust-bors Bot pushed a commit that referenced this pull request Jun 14, 2026
Rollup of 2 pull requests

Successful merges:

 - #157677 (Slightly improve diagnostic impl+output for uncovered type parameters)
 - #157884 (Rename `errors.rs` file to `diagnostics.rs` (9/N))
@rust-bors

rust-bors Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit 2fda233 with merge 4fa96d0...

Workflow: https://github.com/rust-lang/rust/actions/runs/27503272216

rust-bors Bot pushed a commit that referenced this pull request Jun 14, 2026
Slightly improve diagnostic impl+output for uncovered type parameters

Split out of PR #135910. No behavioral changes.

See individual commit messages for details.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 14, 2026
…kh726

Slightly improve diagnostic impl+output for uncovered type parameters

Split out of PR rust-lang#135910. No behavioral changes.

See individual commit messages for details.
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors

rust-bors Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #157893.

rust-bors Bot pushed a commit that referenced this pull request Jun 14, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #157677 (Slightly improve diagnostic impl+output for uncovered type parameters)
 - #157715 (Stop using a fn pointer to normalize_fn_sig inside TypeErrCtxt)
 - #157884 (Rename `errors.rs` file to `diagnostics.rs` (9/N))
@rust-bors

rust-bors Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit 2fda233 with merge 735ac6c...

Workflow: https://github.com/rust-lang/rust/actions/runs/27505463383

rust-bors Bot pushed a commit that referenced this pull request Jun 14, 2026
Slightly improve diagnostic impl+output for uncovered type parameters

Split out of PR #135910. No behavioral changes.

See individual commit messages for details.
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors

rust-bors Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #157894.

rust-bors Bot pushed a commit that referenced this pull request Jun 14, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #157677 (Slightly improve diagnostic impl+output for uncovered type parameters)
 - #157715 (Stop using a fn pointer to normalize_fn_sig inside TypeErrCtxt)
 - #157884 (Rename `errors.rs` file to `diagnostics.rs` (9/N))
 - #157887 (Rename `diagnostic::on_unmatch_args` to `diagnostic::on_unmatched_args`)
 - #157888 (Avoid `&raw` call recovery inside nested delimiters)
@rust-bors rust-bors Bot merged commit e17f934 into rust-lang:main Jun 14, 2026
13 of 14 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 14, 2026
rust-timer added a commit that referenced this pull request Jun 14, 2026
Rollup merge of #157677 - fmease:orphanck-improv-diag, r=jackh726

Slightly improve diagnostic impl+output for uncovered type parameters

Split out of PR #135910. No behavioral changes.

See individual commit messages for details.
@fmease fmease deleted the orphanck-improv-diag branch June 14, 2026 20:42
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.

5 participants