Incorrect error message about enum variant when trying to call a Result #49548
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Test case (playground link):
The real issue is an extra set of parentheses after
foo()
, which should produce an error becauseResult<i32, i32>
is not a function. However, rustc (stable and current nightly) produces this error message:foo()
does evaluate to a value of enum type, it's not a specific variant, and "found enum variantfoo()
" makes it seem likefoo
itself is an enum.help:
is incorrect: neither of the variants of theResult
enum is a unit variant.The text was updated successfully, but these errors were encountered: