mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			522 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			522 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // run-pass
 | |
| 
 | |
| #![feature(coroutines)]
 | |
| 
 | |
| fn main() {
 | |
|     let a = || {
 | |
|         {
 | |
|             let w: i32 = 4;
 | |
|             yield;
 | |
|             println!("{:?}", w);
 | |
|         }
 | |
|         {
 | |
|             let x: i32 = 5;
 | |
|             yield;
 | |
|             println!("{:?}", x);
 | |
|         }
 | |
|         {
 | |
|             let y: i32 = 6;
 | |
|             yield;
 | |
|             println!("{:?}", y);
 | |
|         }
 | |
|         {
 | |
|             let z: i32 = 7;
 | |
|             yield;
 | |
|             println!("{:?}", z);
 | |
|         }
 | |
|     };
 | |
|     assert_eq!(8, std::mem::size_of_val(&a));
 | |
| }
 | 
