Weird error messages when using ?
operator in enum discriminant value
#105242
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
playground
Current output
Why these messages are weird
const
, but I didn't typeconst
. Instead, we're in a const context implied by writing=
while defining an enum discriminant.return
, but I didn't typereturn
. Instead, thereturn
comes from desugaring?
.Ideal output
?
operator outside function body?
with.unwrap()
, perhapsNotes
?
here as a shorthand for.unwrap()
? Either way we want compilation to stop if the value isNone
.The text was updated successfully, but these errors were encountered: