Skip to content

fix: Never make type mismatch diagnostic stable, even when there is a fix #20022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

ChayimFriedman2
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 commented Jun 17, 2025

We show fixes now even for experimental diagnostics anyway, and it has false positives.

Fixes #20021.

We show fixes now even for experimental diagnostics anyway, and it has false positives.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 17, 2025
@Veykril
Copy link
Member

Veykril commented Jun 17, 2025

Type mismatches are probably the most useful diagnostics there are, I don't think marking them as experimental is a good idea.

In the few cases where we are incorrect due to trait solving, people can usually work around it with an extra binding + explicit type annotation if needed.

@ChayimFriedman2 ChayimFriedman2 disabled auto-merge June 17, 2025 09:51
@ChayimFriedman2
Copy link
Contributor Author

ChayimFriedman2 commented Jun 17, 2025

It's already experimental, it was just marked stable when there was a fix (presumably to show the fix), but now we show the fix anyway.

We can discuss stabilizing it, but IMHO the bar for stable diagnostic should be "never has false positive on real code", and this one has many.

@Veykril Veykril enabled auto-merge June 17, 2025 09:57
@Veykril Veykril added this pull request to the merge queue Jun 17, 2025
Merged via the queue into rust-lang:master with commit 630628f Jun 17, 2025
14 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the type-mismatch-exp branch June 17, 2025 10:34
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diagnostic error due to wrong APIT inference
3 participants