We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fn baz() -> impl std::fmt::Display { if false { return 0i32; } else { 1u32 } }
currently points at the entire if/else
if
else
error[E0308]: mismatched types --> src/lib.rs:2:5 | 1 | fn baz() -> impl std::fmt::Display { | ---------------------- expected because this return type... 2 | / if false { 3 | | 4 | | return 0i32; | | ---- ...is found to be `i32` here 5 | | } else { 6 | | 1u32 7 | | } | |_____^ expected i32, found u32 | = note: expected type `i32` found type `u32`
It should probably point at the else expression
error[E0308]: mismatched types --> src/lib.rs:2:5 | 1 | fn baz() -> impl std::fmt::Display { | ---------------------- expected because this return type... 2 | if false { 3 | 4 | return 0i32; | ---- ...is found to be `i32` here 5 | } else { 6 | 1u32 | ^^^^ expected i32, found u32 7 | } | = note: expected type `i32` found type `u32`
The text was updated successfully, but these errors were encountered:
Taken from https://github.com/rust-lang/rust/pull/57793/files#r249357841
Sorry, something went wrong.
Rollup merge of rust-lang#64083 - estebank:tweak-e0308, r=oli-obk
1893c61
Point at appropriate arm on type error on if/else/match with one non-! arm Fix rust-lang#61281.
59237ec
Successfully merging a pull request may close this issue.
currently points at the entire
if
/else
It should probably point at the
else
expressionThe text was updated successfully, but these errors were encountered: