@@ -2197,7 +2197,7 @@ fn trans_unary(bcx: @block_ctxt, op: ast::unop, e: @ast::expr,
2197
2197
}
2198
2198
ast:: neg. {
2199
2199
let { bcx, val} = trans_temp_expr ( bcx, e) ;
2200
- let neg = if ty:: struct ( bcx_tcx ( bcx) , e_ty) == ty :: ty_float {
2200
+ let neg = if ty:: type_is_fp ( bcx_tcx ( bcx) , e_ty) {
2201
2201
FNeg ( bcx, val)
2202
2202
} else { Neg ( bcx, val) } ;
2203
2203
ret store_in_dest ( bcx, neg, dest) ;
@@ -2287,14 +2287,10 @@ fn trans_eager_binop(cx: @block_ctxt, op: ast::binop, lhs: ValueRef,
2287
2287
lhs_t : ty:: t , rhs : ValueRef , rhs_t : ty:: t , dest : dest )
2288
2288
-> @block_ctxt {
2289
2289
if dest == ignore { ret cx; }
2290
- let is_float = false ;
2291
2290
let intype = lhs_t;
2292
2291
if ty:: type_is_bot ( bcx_tcx ( cx) , intype) { intype = rhs_t; }
2292
+ let is_float = ty:: type_is_fp ( bcx_tcx ( cx) , intype) ;
2293
2293
2294
- alt ty:: struct ( bcx_tcx ( cx) , intype) {
2295
- ty:: ty_float. { is_float = true ; }
2296
- _ { is_float = false ; }
2297
- }
2298
2294
if op == ast:: add && ty:: type_is_sequence ( bcx_tcx ( cx) , intype) {
2299
2295
ret tvec:: trans_add ( cx, intype, lhs, rhs, dest) ;
2300
2296
}
0 commit comments