Skip to content

Commit 451ec03

Browse files
committed
Clean up old FIXME regarding or-patterns
1 parent b1d2a00 commit 451ec03

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/comp/middle/trans.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,21 +1684,15 @@ tag scalar_type { nil_type; signed_int; unsigned_int; floating_point; }
16841684

16851685
fn compare_scalar_types(cx: @block_ctxt, lhs: ValueRef, rhs: ValueRef,
16861686
t: &ty::t, llop: ValueRef) -> result {
1687-
// FIXME: this could be a lot shorter if we could combine multiple cases
1688-
// of alt expressions (issue #449).
1689-
16901687
let f = bind compare_scalar_values(cx, lhs, rhs, _, llop);
16911688

1692-
16931689
alt ty::struct(bcx_tcx(cx), t) {
16941690
ty::ty_nil. { ret f(nil_type); }
1695-
ty::ty_bool. { ret f(unsigned_int); }
1691+
ty::ty_bool. | ty::ty_uint. | ty::ty_ptr(_) |
1692+
ty::ty_char. { ret f(unsigned_int); }
16961693
ty::ty_int. { ret f(signed_int); }
16971694
ty::ty_float. { ret f(floating_point); }
1698-
ty::ty_uint. { ret f(unsigned_int); }
16991695
ty::ty_machine(_) {
1700-
1701-
17021696
if ty::type_is_fp(bcx_tcx(cx), t) {
17031697
// Floating point machine types
17041698
ret f(floating_point);
@@ -1710,7 +1704,6 @@ fn compare_scalar_types(cx: @block_ctxt, lhs: ValueRef, rhs: ValueRef,
17101704
ret f(unsigned_int);
17111705
}
17121706
}
1713-
ty::ty_char. { ret f(unsigned_int); }
17141707
ty::ty_type. {
17151708
trans_fail(cx, none[span], "attempt to compare values of type type");
17161709

@@ -1724,7 +1717,6 @@ fn compare_scalar_types(cx: @block_ctxt, lhs: ValueRef, rhs: ValueRef,
17241717
"attempt to compare values of type native");
17251718
ret rslt(new_sub_block_ctxt(cx, "after_fail_dummy"), C_bool(false));
17261719
}
1727-
ty::ty_ptr(_) { ret f(unsigned_int); }
17281720
_ {
17291721
// Should never get here, because t is scalar.
17301722
bcx_ccx(cx).sess.bug("non-scalar type passed to \

0 commit comments

Comments
 (0)