diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-09-15 23:14:24 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-09-15 23:22:12 -0700 |
| commit | 059b31f7a3a58193db1dc80a3bd32cbb36f00e1d (patch) | |
| tree | 411188d95bc19891b4427de1f058cecade290a47 /src/comp | |
| parent | 57ede5f281a406986d4167bbca137d09e6a7f565 (diff) | |
Actually call unreachable() in impossible case in type_of_inner
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/trans.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 4a1e7c4cd42..42d57031d64 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -210,9 +210,11 @@ fn type_of_inner(cx: @crate_ctxt, sp: span, t: ty::t) ret T_struct([T_i32(), type_of_inner(cx, sp, sub1)]); } ty::ty_var(_) { - // FIXME should be a constraint that makes this impossible - // (use unreachable()) - cx.tcx.sess.span_fatal(sp, "trans::type_of called on ty_var"); + // Should be unreachable b/c of precondition. + // FIXME: would be nice to have a way of expressing this + // through postconditions, and then making it sound to omit + // cases in the alt + std::util::unreachable() } ty::ty_param(_, _) { T_typaram(cx.tn) } ty::ty_type. { T_ptr(cx.tydesc_type) } |
