Skip to content

feat: Feature a "type annotations needed" diagnostic when an infer var cannot be resolved at the end of inference#22168

Merged
ChayimFriedman2 merged 2 commits intorust-lang:masterfrom
ChayimFriedman2:type-must-be-known-v2
Apr 24, 2026
Merged

feat: Feature a "type annotations needed" diagnostic when an infer var cannot be resolved at the end of inference#22168
ChayimFriedman2 merged 2 commits intorust-lang:masterfrom
ChayimFriedman2:type-must-be-known-v2

Conversation

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

This is case 1 in the description #22144, and completes the cases where this diagnostic should be emitted.

While it mostly works fine and with no false positives (there are false negatives though when we're incorrectly using dummy spans), this diagnostic is not stabilizeable as-is IMO, as the reporting can be a bit unclear. We should polish that a bit (feedback from users will help).

This is required for reporting unresolved vars, which will come in the next commit.
@ChayimFriedman2 ChayimFriedman2 marked this pull request as ready for review April 24, 2026 12:28
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 24, 2026
@ChayimFriedman2 ChayimFriedman2 changed the title feat: Feature a "type annotations needed diagnostic" when an infer var cannot be resolved at the end of inference feat: Feature a "type annotations needed" diagnostic when an infer var cannot be resolved at the end of inference Apr 24, 2026
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 24, 2026
Merged via the queue into rust-lang:master with commit 91be466 Apr 24, 2026
18 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the type-must-be-known-v2 branch April 24, 2026 13:51
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants