Using ? behind collect without turbofish gives confusing error message, not hinting at wrong type. #85695
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Following up from #49391 @estebank
Not sure if the compiler can be clever about this.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e30b2fc110718876664dd046492b4dc5
The current output is:
Ideally the output be:
This also will happen correctly when the function call taking the strings is not used. Apparently that function call put the compiler to the wrong direction what should be the correct fix to the code.
The text was updated successfully, but these errors were encountered: