@@ -7129,7 +7129,7 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
7129
7129
methods = anon_obj. methods,
7130
7130
dtor = none[ @ast:: method] ) ;
7131
7131
7132
- let result with_obj_val;
7132
+ let option :: t [ result] with_obj_val = none ;
7133
7133
let ty:: t with_obj_ty;
7134
7134
auto vtbl;
7135
7135
alt ( anon_obj. with_obj) {
@@ -7155,7 +7155,7 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
7155
7155
// If with_obj (the object being extended) exists, translate it.
7156
7156
// Translating with_obj returns a ValueRef (pointer to a 2-word
7157
7157
// value) wrapped in a result.
7158
- with_obj_val = trans_expr( bcx, e) ;
7158
+ with_obj_val = some ( trans_expr( bcx, e) ) ;
7159
7159
7160
7160
// TODO: What makes more sense to get the type of an expr --
7161
7161
// calling ty::expr_ty(ccx.tcx, e) on it or calling
@@ -7332,9 +7332,13 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
7332
7332
GEP_tup_like ( bcx, body_ty, body. val,
7333
7333
~[ 0 , abi:: obj_body_elt_with_obj] ) ;
7334
7334
bcx = body_with_obj. bcx;
7335
- bcx = copy_val( bcx, INIT , body_with_obj. val,
7336
- with_obj_val. val,
7337
- with_obj_ty) . bcx;
7335
+ alt ( with_obj_val) {
7336
+ case ( some( ?v) ) {
7337
+ bcx = copy_val( bcx, INIT , body_with_obj. val,
7338
+ v. val, with_obj_ty) . bcx;
7339
+ }
7340
+ case ( _) { }
7341
+ }
7338
7342
7339
7343
// Store box ptr in outer pair.
7340
7344
auto p = bcx. build. PointerCast ( box. val, llbox_ty) ;
0 commit comments