rustc should suggest a cast from anonymous function type to function pointer #91258
Labels
A-coercions
Area: implicit and explicit `expr as Type` coercions
A-diagnostics
Area: Messages for errors, warnings, and lints
D-lack-of-suggestion
Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I have been told in Discord that:
"rustc should be able to see that one is an anonymous fn type and the other a fn pointer with the same call signature"
and that I should open an issue.
Given the following code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b35796ef8b42be226dbba7c213fbd348
The current output is:
Ideally the output should add a note, something like:
The text was updated successfully, but these errors were encountered: