]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #33169 - swgillespie:issue32829, r=eddyb
authorbors <bors@rust-lang.org>
Thu, 12 May 2016 02:48:54 +0000 (19:48 -0700)
committerbors <bors@rust-lang.org>
Thu, 12 May 2016 02:48:54 +0000 (19:48 -0700)
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 .


Trivial merge