@@ -517,12 +517,13 @@ fn trans_alt(cx: &@block_ctxt, expr: &@ast::expr, arms: &[ast::arm],
517
517
518
518
// Not alt-related, but similar to the pattern-munging code above
519
519
fn bind_irrefutable_pat ( bcx : @block_ctxt , pat : & @ast:: pat , val : ValueRef ,
520
- table : hashmap[ ast:: node_id , ValueRef ] , copy : bool )
520
+ table : hashmap[ ast:: node_id , ValueRef ] ,
521
+ make_copy : bool )
521
522
-> @block_ctxt {
522
523
let ccx = bcx. fcx . lcx . ccx ;
523
524
alt pat. node {
524
525
ast:: pat_bind ( _) {
525
- if copy {
526
+ if make_copy {
526
527
let ty = ty:: node_id_to_monotype ( ccx. tcx , pat. id ) ;
527
528
let llty = trans:: type_of ( ccx, pat. span , ty) ;
528
529
let alloc = trans:: alloca ( bcx, llty) ;
@@ -541,7 +542,8 @@ fn bind_irrefutable_pat(bcx: @block_ctxt, pat: &@ast::pat, val: ValueRef,
541
542
let args = extract_variant_args ( bcx, pat. id , vdefs, val) ;
542
543
let i = 0 ;
543
544
for argval: ValueRef in args. vals {
544
- bcx = bind_irrefutable_pat ( bcx, sub. ( i) , argval, table, copy) ;
545
+ bcx = bind_irrefutable_pat ( bcx, sub. ( i) , argval, table,
546
+ make_copy) ;
545
547
i += 1 ;
546
548
}
547
549
}
@@ -553,15 +555,15 @@ fn bind_irrefutable_pat(bcx: @block_ctxt, pat: &@ast::pat, val: ValueRef,
553
555
let ix: uint =
554
556
ty:: field_idx ( ccx. sess , pat. span , f. ident , rec_fields) ;
555
557
let r = trans:: GEP_tup_like ( bcx, rec_ty, val, ~[ 0 , ix as int ] ) ;
556
- bcx = bind_irrefutable_pat ( r. bcx , f. pat , r. val , table, copy ) ;
558
+ bcx = bind_irrefutable_pat ( r. bcx , f. pat , r. val , table, make_copy ) ;
557
559
}
558
560
}
559
561
ast:: pat_tup ( elems) {
560
562
let tup_ty = ty:: node_id_to_monotype ( ccx. tcx , pat. id ) ;
561
563
let i = 0 u;
562
564
for elem in elems {
563
565
let r = trans:: GEP_tup_like ( bcx, tup_ty, val, ~[ 0 , i as int ] ) ;
564
- bcx = bind_irrefutable_pat ( r. bcx , elem, r. val , table, copy ) ;
566
+ bcx = bind_irrefutable_pat ( r. bcx , elem, r. val , table, make_copy ) ;
565
567
i += 1 u;
566
568
}
567
569
}
0 commit comments