Skip to content
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

trans: Add early-out when translating unreachable controlflow expressions. #23066

Merged
merged 1 commit into from
Apr 2, 2015

Conversation

michaelwoerister
Copy link
Member

This PR solves #21559 by making sure that unreachable if-expressions are not further translated.

Could someone who knows their way around trans take a look at the changes in controlflow.rs? I'm not sure if any other code relies on any side-effects of translating unreachable things.

cc @nikomatsakis @nrc @eddyb

@rust-highfive
Copy link
Collaborator

r? @pcwalton

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

@@ -83,3 +163,5 @@ fn main() {
fn diverge() -> ! {
panic!();
}

fn some_predicate() -> bool { true || false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no newline at end of file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed that.

@pnkfelix
Copy link
Member

r? @pnkfelix

@rust-highfive rust-highfive assigned pnkfelix and unassigned pcwalton Mar 30, 2015
@pnkfelix
Copy link
Member

pnkfelix commented Apr 1, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Apr 1, 2015

📌 Commit e05c2f8 has been approved by pnkfelix

@pnkfelix
Copy link
Member

pnkfelix commented Apr 1, 2015

@bors rollup

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 1, 2015
…pnkfelix

This PR solves rust-lang#21559 by making sure that unreachable if-expressions are not further translated.

Could someone who knows their way around `trans` take a look at the changes in `controlflow.rs`? I'm not sure if any other code relies on any side-effects of translating unreachable things.

cc @nikomatsakis @nrc @eddyb
@alexcrichton alexcrichton merged commit e05c2f8 into rust-lang:master Apr 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants