1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
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); }