about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-08-13 00:41:22 +0000
committerbors <bors@rust-lang.org>2014-08-13 00:41:22 +0000
commite189122e9a922438f02b639948f75df765cd370e (patch)
tree6909df7e52b3d51c57ed095e1944fc51e732b8c7 /src/rustllvm/RustWrapper.cpp
parent51c7e20d539eaed6e765612a02fbf2865e08a1bc (diff)
parent0f847ba74da083124f3d5d38d36fc1135737c12c (diff)
downloadrust-e189122e9a922438f02b639948f75df765cd370e.tar.gz
rust-e189122e9a922438f02b639948f75df765cd370e.zip
auto merge of #16452 : epdtry/rust/unreachable-item-ice, r=pcwalton
This code produces an ICE:

```rust
#![crate_type = "rlib"]
fn main() {
    if true { return }
    // remaining code is unreachable
    match () {
        () => { static MAGIC: uint = 0; }
    }
}
```
([playpen](http://is.gd/iwOISB))

The error is "encode_symbol: id not found 18", where 18 is the `NodeId` of the declaration of `MAGIC`.  The problem is that `rustc` tries to emit metadata for `MAGIC`, but some of the information is missing because `MAGIC` never gets translated by `trans_item` - the entire body of the `match` gets skipped because the `match` itself is unreachable.

This branch simplifies the handling of inner items by always processing them using the `trans_item` visitor, instead of sometimes using the visitor and sometimes waiting until `trans_stmt` encounters the item.  This fixes the ICE by making the translation of the item no longer depend on the declaration being reachable code.  This branch also reverts #16059 and #16359, since the new change to item translation fixes the same problems as those but is simpler.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions