-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Print a friendly error for the if-let construct without an else block #20039
New issue
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
Conversation
r? @nick29581 (rust_highfive has picked a reviewer for you, use r? to override) |
Can you add a compile-fail test for the new error message? |
), | ||
_ => ( | ||
infer::MatchExpressionArm(expr.span, arm.body.span), | ||
result_ty, // result_ty is "expected" here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this comment any more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the "expected"-related ones? I will remove them.
d2d88c5
to
5ed3ab0
Compare
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment saying what the test is testing.
Thanks for the fixes! Looks good, r=me with an extra comment in the test. |
5ed3ab0
to
314ed2d
Compare
fix: Closure capturing for let exprs
Fixes #19991.