diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-09-24 23:46:28 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-09-24 23:52:22 -0700 |
| commit | 98db2febd33ee0cc20d149574cb8c8987587bc03 (patch) | |
| tree | a2053847ee6aa78c0b9971c8db24f29833bcd560 /src/comp | |
| parent | 895674b6eb99e65852a6c4d0f44cc1acf9413f03 (diff) | |
| download | rust-98db2febd33ee0cc20d149574cb8c8987587bc03.tar.gz rust-98db2febd33ee0cc20d149574cb8c8987587bc03.zip | |
Handle ~fail. Closes #968
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/trans_uniq.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/comp/middle/trans_uniq.rs b/src/comp/middle/trans_uniq.rs index 5bae18731e7..68e9117de01 100644 --- a/src/comp/middle/trans_uniq.rs +++ b/src/comp/middle/trans_uniq.rs @@ -31,6 +31,13 @@ fn trans_uniq(cx: @block_ctxt, contents: @ast::expr, bcx = lv.bcx; let uniq_ty = node_id_type(bcx_ccx(cx), node_id); + + if ty::type_is_bot(bcx_tcx(bcx), uniq_ty) { + // FIXME: Seems to work, obviously not 'right'. Story of my life. + // Probably works because the builder turns lv.val into undef + ret rslt(bcx, lv.val); + } + check type_is_unique_box(bcx, uniq_ty); let content_ty = content_ty(bcx, uniq_ty); let {bcx, val: llptr} = alloc_uniq(bcx, uniq_ty); |
