Skip to content

Conversation

RalfJung
Copy link
Member

All function calleess are either FnPtr or FnDef, so we can remove the alternative from check_consts and just make it ICE instead.

@rust-highfive
Copy link
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 14, 2020
@rust-highfive

This comment has been minimized.

@RalfJung
Copy link
Member Author

Cc @oli-obk @ecstatic-morse

I also wondered why visit_terminator_kind exists, but no corresponding visit_statement_kind. Looks to me like for consistency we should either add the latter or, more likely, remove the former?

@@ -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,)
Copy link
Member

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.

Copy link
Member

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).

Copy link
Member Author

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.)

@eddyb
Copy link
Member

eddyb commented Apr 16, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 16, 2020

📌 Commit 49b745f has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 16, 2020
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.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 16, 2020
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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 16, 2020
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
@bors bors merged commit 7da24a2 into rust-lang:master Apr 16, 2020
@RalfJung RalfJung deleted the check-const-call branch April 16, 2020 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants