-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
remove an impossible branch from check_consts #71149
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
I also wondered why |
af1ed3d
to
3fbc603
Compare
@@ -511,8 +511,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> { | |||
return; | |||
} | |||
_ => { | |||
self.check_op(ops::FnCallOther); | |||
return; | |||
span_bug!(terminator.source_info.span, "invalid callee of type {:?}", fn_ty,) |
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.
Extra comma on the end, heh.
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.
Oh, also, I don't think you need to change the method, try self.span
here (courtesy of visit_source_info
above).
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.
Hm, it still seems more consistent to use visit_terminator
since we also use visit_statement
.
(I am thinking about, in a separate PR, just removing visit_terminator_kind
unless someone has a good explanation for why it should even exist.)
1e04b63
to
49b745f
Compare
@bors r+ |
📌 Commit 49b745f has been approved by |
remove an impossible branch from check_consts All function calleess are either `FnPtr` or `FnDef`, so we can remove the alternative from check_consts and just make it ICE instead.
remove an impossible branch from check_consts All function calleess are either `FnPtr` or `FnDef`, so we can remove the alternative from check_consts and just make it ICE instead.
Rollup of 5 pull requests Successful merges: - rust-lang#70566 (Don't bail out before linting in generic contexts.) - rust-lang#71141 (Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa) - rust-lang#71149 (remove an impossible branch from check_consts) - rust-lang#71179 (fix more clippy warnings) - rust-lang#71191 (Clean up E0520 explanation) Failed merges: r? @ghost
All function calleess are either
FnPtr
orFnDef
, so we can remove the alternative from check_consts and just make it ICE instead.