Skip to content

fix: Remove a redundant <never-to-any> from adjustment hints for let-else #13765

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

Conversation

WaffleLapkin
Copy link
Member

@WaffleLapkin WaffleLapkin commented Dec 13, 2022

Before:
2022-12-13_16-44
After:
2022-12-13_18-07

I'm not sure why an adjustment is there at all, given that else block in let-else must always evaluate to !, but we can suppress it I guess...

Continuation of #13749

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 13, 2022
@Veykril
Copy link
Member

Veykril commented Dec 13, 2022

We seem to emit a never to never coercion there

@Veykril
Copy link
Member

Veykril commented Dec 20, 2022

So ye this is most likely a never to never coercion as can be seen here
image

Now, the question is whether this coercion makes sense? (Though I assume rust also does it, in which case we should keep it)
The proper fix I think would be to probably reveal the types in the adjustment HIR api (I was lazy and figured I wouldn't need them for now which is why they are currently missing from the HIR api) and then check if this is a never to never coercion.

@WaffleLapkin
Copy link
Member Author

Having types in the tooltips can be interesting too 👀

@Veykril
Copy link
Member

Veykril commented Dec 20, 2022

Certainly, the hover messages have a lot of room for imrpovements. fwiw adding types to the API is only a matter of transforming the hir_ty::Ty into a hir::Type and exposing them iwth the adjustment kinds.

@bors
Copy link
Contributor

bors commented Dec 20, 2022

☔ The latest upstream changes (presumably #13804) made this pull request unmergeable. Please resolve the merge conflicts.

@WaffleLapkin WaffleLapkin deleted the redundant_never_to_any_let_else branch December 20, 2022 20:39
bors added a commit that referenced this pull request Dec 20, 2022
fix: Skip adjustment hints if the adjustment is identity (`T` -> `T`)

Supersedes #13765
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.

4 participants