Confusing hint on missing parentheses after collect<> #67680
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code produces a quite unhelpful error from the compiler:
The error in question being
.collect::<Result<Vec<_>, io::Error>>?;
instead of.collect::<Result<Vec<_>, io::Error>>()?;
.Compiler output:
It's quite a simple mistake, but I got confused by the error message and tried different type-related fixes which didn't work (obviously).
This might be related to #54521
The text was updated successfully, but these errors were encountered: