mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			244 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			244 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
//@ run-pass
 | 
						|
 | 
						|
struct Recbox<T> {x: Box<T>}
 | 
						|
 | 
						|
fn reclift<T>(t: T) -> Recbox<T> { return Recbox { x: Box::new(t) }; }
 | 
						|
 | 
						|
pub fn main() {
 | 
						|
    let foo: isize = 17;
 | 
						|
    let rbfoo: Recbox<isize> = reclift::<isize>(foo);
 | 
						|
    assert_eq!(*rbfoo.x, foo);
 | 
						|
}
 |