File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -3583,12 +3583,12 @@ fn trans_for_each(@block_ctxt cx,
3583
3583
bcx. build. Store ( lllvar, lllvarptr) ;
3584
3584
fcx. llupvars. insert( decl_id, lllvarptr) ;
3585
3585
3586
- auto res = trans_block( bcx, body) ;
3586
+ auto r = trans_block( bcx, body) ;
3587
3587
3588
3588
// Tie up the llallocas -> lltop edge.
3589
3589
new_builder( fcx. llallocas) . Br ( lltop) ;
3590
3590
3591
- res . bcx. build. RetVoid ( ) ;
3591
+ r . bcx. build. RetVoid ( ) ;
3592
3592
3593
3593
3594
3594
// Step 3: Call iter passing [lliterbody, llenv], plus other args.
@@ -3611,10 +3611,11 @@ fn trans_for_each(@block_ctxt cx,
3611
3611
cx. build. Store ( llenvblobptr, env_cell) ;
3612
3612
3613
3613
// log "lliterbody: " + val_str(cx.fcx.lcx.ccx.tn, lliterbody);
3614
- ret trans_call( cx, f,
3614
+ r = trans_call( cx, f,
3615
3615
some[ ValueRef ] ( cx. build. Load ( pair) ) ,
3616
3616
args,
3617
3617
ann) ;
3618
+ ret res( r. bcx, C_nil ( ) ) ;
3618
3619
}
3619
3620
}
3620
3621
fail;
Original file line number Diff line number Diff line change
1
+ tag thing { a; b; c; }
2
+
3
+ iter foo ( ) -> int {
4
+ put 10 ;
5
+ }
6
+
7
+ fn main ( ) {
8
+ auto x = true ;
9
+ alt ( a) {
10
+ case ( a) {
11
+ x = true ;
12
+ for each ( int i in foo( ) ) {
13
+ }
14
+ }
15
+ case ( b) {
16
+ x = false ;
17
+ }
18
+ case ( c) {
19
+ x = false ;
20
+ }
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments