-
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
const_fn: Check the terminating expression of a block for blocks in a const initializer #33169
Conversation
r? @jroesch (rust_highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #33130) made this pull request unmergeable. Please resolve the merge conflicts. |
@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. |
@eddyb will do! |
@eddyb This works fine with your changes so this PR is just a regression test now. |
@bors r+ |
📌 Commit 2467d40 has been approved by |
⌛ Testing commit 2467d40 with merge 926cee0... |
💔 Test failed - auto-linux-64-opt-rustbuild |
@swgillespie Aww, tidy failure. |
@eddyb should be fixed now. |
@bors r+ |
📌 Commit 94a0552 has been approved by |
⌛ Testing commit 94a0552 with merge bcf107c... |
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
@bors: retry
On Wed, May 11, 2016 at 3:15 AM, bors [email protected] wrote:
|
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 .
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 .