mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			282 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			282 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
 | 
						|
    match (&t,) {
 | 
						|
        ((u,),) => u,
 | 
						|
        //~^ ERROR lifetime may not live long enough
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
    let x = {
 | 
						|
        let y = Box::new((42,));
 | 
						|
        transmute_lifetime(&y)
 | 
						|
    };
 | 
						|
 | 
						|
    println!("{}", x);
 | 
						|
}
 |