Weird compiler error for type annotations #64524
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
(Playground)
Error will be
Which is a little bit confusing because there's no type parameter
F
instd::result::Result<i32, E>
.On the other hand, if we place
let handler = |a| Ok(a + 1);
beforelet result = spawned_result.map_err(|e| e.into());
, we will receive correct message:The text was updated successfully, but these errors were encountered: