Skip to content

avoid spurious lifetime diagnostic in async generic case#158153

Open
pbkx wants to merge 1 commit into
rust-lang:mainfrom
pbkx:issue-115376-async-spurious-static-bound
Open

avoid spurious lifetime diagnostic in async generic case#158153
pbkx wants to merge 1 commit into
rust-lang:mainfrom
pbkx:issue-115376-async-spurious-static-bound

Conversation

@pbkx

@pbkx pbkx commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #115376.

Issue #115376 reports duplicate lifetime diagnostics for a small async generic example where rustc already emits the real T: 'static error. Additionally, it emits diagnostics requiring the same generic type to outlive a shorter anonymous lifetime

My PR keeps the real static-bound diagnostic and filters same-span weaker type-test diagnostics for the same generic when the failed G: 'static bound already covers them. New regression test verifies that the async example emits only the real E0310 diagnostic. One existing borrowck test was updated for the same diagnostic cleanup

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 19, 2026
@pbkx pbkx marked this pull request as ready for review June 19, 2026 21:56
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 19, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 19, 2026
@rustbot

rustbot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

r? @folkertdev

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

@folkertdev

Copy link
Copy Markdown
Contributor

r? types

@rustbot rustbot added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Jun 19, 2026
@rustbot rustbot assigned jackh726 and unassigned folkertdev Jun 19, 2026
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. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiple spurious errors when T: 'static is required in async fn

4 participants