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

const_fn: Check the terminating expression of a block for blocks in a const initializer #33169

Merged
merged 1 commit into from
May 12, 2016

Conversation

swgillespie
Copy link
Contributor

In a const or static initializer, the CheckBlock check ensures that blocks in the initializer expression are only in tail positions or in items. In this case, it didn't check the terminating expression of a block, which resulted in an ICE later in the compiler pipeline if the trailing expression was itself a block. This change fixes the ICE and ensures that the proper error is emitted. This fixes the ICE in #32829 .

@rust-highfive
Copy link
Collaborator

r? @jroesch

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

@bors
Copy link
Contributor

bors commented May 8, 2016

☔ The latest upstream changes (presumably #33130) made this pull request unmergeable. Please resolve the merge conflicts.

@eddyb
Copy link
Member

eddyb commented May 9, 2016

@swgillespie Can you rebase and check if these tests cause errors without any actual changes to the compiler? The approach taken in #33130 is a bit more general than the old checks.

@swgillespie
Copy link
Contributor Author

@eddyb will do!

@swgillespie
Copy link
Contributor Author

@eddyb This works fine with your changes so this PR is just a regression test now.

@eddyb
Copy link
Member

eddyb commented May 10, 2016

@bors r+

@bors
Copy link
Contributor

bors commented May 10, 2016

📌 Commit 2467d40 has been approved by eddyb

@bors
Copy link
Contributor

bors commented May 10, 2016

⌛ Testing commit 2467d40 with merge 926cee0...

@bors
Copy link
Contributor

bors commented May 10, 2016

💔 Test failed - auto-linux-64-opt-rustbuild

@eddyb
Copy link
Member

eddyb commented May 10, 2016

@swgillespie Aww, tidy failure.

@swgillespie
Copy link
Contributor Author

@eddyb should be fixed now.

@eddyb
Copy link
Member

eddyb commented May 11, 2016

@bors r+

@bors
Copy link
Contributor

bors commented May 11, 2016

📌 Commit 94a0552 has been approved by eddyb

@bors
Copy link
Contributor

bors commented May 11, 2016

⌛ Testing commit 94a0552 with merge bcf107c...

@bors
Copy link
Contributor

bors commented May 11, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@alexcrichton
Copy link
Member

@bors: retry

  • builder disappeared

On Wed, May 11, 2016 at 3:15 AM, bors [email protected] wrote:

[image: 💔] Test failed - auto-win-gnu-32-opt-rustbuild
http://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt-rustbuild/builds/1080


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#33169 (comment)

@bors
Copy link
Contributor

bors commented May 12, 2016

⌛ Testing commit 94a0552 with merge ed1ece6...

bors added a commit that referenced this pull request May 12, 2016
const_fn: Check the terminating expression of a block for blocks in a const initializer

In a const or static initializer, the `CheckBlock` check ensures that blocks in the initializer expression are only in tail positions or in items. In this case, it didn't check the terminating expression of a block, which resulted in an ICE later in the compiler pipeline if the trailing expression was itself a block. This change fixes the ICE and ensures that the proper error is emitted. This fixes the ICE in #32829 .
@bors bors merged commit 94a0552 into rust-lang:master May 12, 2016
@swgillespie swgillespie deleted the issue32829 branch May 12, 2016 06:29
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.

6 participants