Open
Description
As brought up in #51479, Result<A, i32>::Err(0)
and Result<B, i32>::Err(0)
are not of the same type. We should add a note (or ideally a structured suggestion on what to write) explaining this.
error[E0308]: `match` arms have incompatible types
--> src/lib.rs:8:16
|
6 | / match f2() {
7 | | Ok(value) => Ok(value as i64),
| | ---------------- this is found to be of type `Result<i64, String>`
8 | | err => err,
| | ^^^ expected `i64`, found `i32`
9 | | }
| |_____- `match` arms have incompatible types
|
= note: expected enum `Result<i64, _>`
found enum `Result<i32, _>`
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.