Skip to content

Commit fec6e67

Browse files
committed
---
yaml --- r: 4257 b: refs/heads/master c: 451ec03 h: refs/heads/master i: 4255: b6def57 v: v3
1 parent 1ec2e9a commit fec6e67

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b1d2a00b4a8846900b2456a4bda7952af26b8625
2+
refs/heads/master: 451ec03c2df60c26f888cd9762b6f416415a38fb

trunk/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)