mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			232 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			232 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // Tests the new destructor semantics.
 | |
| 
 | |
| use std::cell::RefCell;
 | |
| 
 | |
| fn main() {
 | |
|     let b = {
 | |
|         let a = Box::new(RefCell::new(4));
 | |
|         *a.borrow() + 1
 | |
|     }; //~^ ERROR `*a` does not live long enough
 | |
|     println!("{}", b);
 | |
| }
 | 
