-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add a missing error-return case. #41181
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
src/libsyntax/parse/parser.rs
Outdated
@@ -4763,6 +4763,8 @@ impl<'a> Parser<'a> { | |||
err.span_label(sp, &"missing `fn`"); | |||
} | |||
return Err(err); | |||
} else if let Err(bang_err) = bang_err { | |||
return Err(bang_err); |
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 feel that if this code used explicit match, mistake wouldn't have been made. Something like
match (err, bang_err) {
(Err(_), Err(_)) => ...
(Err(_), _) => ...
...
}
While I agree @nagisa has a good suggestion, I also think this change is simple enough and the ICE is problematic enough that I'd rather just land this as is. |
Yeah, that’s why I didn’t do a “red cross, can’t land this”-sort of review and a commented instead. |
@bors r+ |
📌 Commit 1e19647 has been approved by |
@bors rollup |
Wait, I just made the change :p |
@bors r- |
🔑 Insufficient privileges |
@bors r- |
There's #41282 in queue which also fixes this issue. |
☔ The latest upstream changes (presumably #41282) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes #41161.
It was a little mistake in #40815.