@@ -3367,7 +3367,7 @@ fn trans_compare(&@block_ctxt cx0, ast::binop op, &ty::t t0, ValueRef lhs0,
3367
3367
auto rhs_r = autoderef( cx, rhs0, t0) ;
3368
3368
auto rhs = rhs_r. val;
3369
3369
cx = rhs_r. bcx;
3370
- auto t = autoderefed_ty ( cx. fcx. lcx. ccx, t0) ;
3370
+ auto t = ty :: type_autoderef ( cx. fcx. lcx. ccx. tcx , t0) ;
3371
3371
// Determine the operation we need.
3372
3372
// FIXME: Use or-patterns when we have them.
3373
3373
@@ -4126,17 +4126,6 @@ fn autoderef(&@block_ctxt cx, ValueRef v, &ty::t t) -> result {
4126
4126
ret rslt( cx, v1) ;
4127
4127
}
4128
4128
4129
- fn autoderefed_ty( & @crate_ctxt ccx, & ty:: t t) -> ty:: t {
4130
- let ty:: t t1 = t;
4131
- while ( true) {
4132
- alt ( ty:: struct ( ccx. tcx, t1) ) {
4133
- case ( ty:: ty_box( ?mt) ) { t1 = mt. ty; }
4134
- case ( _) { break ; }
4135
- }
4136
- }
4137
- ret t1;
4138
- }
4139
-
4140
4129
fn trans_binary( & @block_ctxt cx, ast:: binop op, & @ast:: expr a, & @ast:: expr b)
4141
4130
-> result {
4142
4131
@@ -4199,7 +4188,7 @@ fn trans_binary(&@block_ctxt cx, ast::binop op, &@ast::expr a, &@ast::expr b)
4199
4188
auto rhty = ty:: expr_ty( cx. fcx. lcx. ccx. tcx, b) ;
4200
4189
rhs = autoderef( rhs. bcx, rhs. val, rhty) ;
4201
4190
ret trans_eager_binop( rhs. bcx, op,
4202
- autoderefed_ty ( cx. fcx. lcx. ccx, lhty) ,
4191
+ ty :: type_autoderef ( cx. fcx. lcx. ccx. tcx , lhty) ,
4203
4192
lhs. val, rhs. val) ;
4204
4193
}
4205
4194
}
@@ -4910,7 +4899,7 @@ fn trans_path(&@block_ctxt cx, &ast::path p, ast::node_id id) -> lval_result {
4910
4899
fn trans_field( & @block_ctxt cx, & span sp, ValueRef v, & ty:: t t0,
4911
4900
& ast:: ident field, ast:: node_id id) -> lval_result {
4912
4901
auto r = autoderef( cx, v, t0) ;
4913
- auto t = autoderefed_ty ( cx. fcx. lcx. ccx, t0) ;
4902
+ auto t = ty :: type_autoderef ( cx. fcx. lcx. ccx. tcx , t0) ;
4914
4903
alt ( ty:: struct ( cx. fcx. lcx. ccx. tcx, t) ) {
4915
4904
case ( ty:: ty_tup( _) ) {
4916
4905
let uint ix = ty:: field_num( cx. fcx. lcx. ccx. sess, sp, field) ;
0 commit comments