blob: a016924a869a8c09f082247b0c8726a6831ac109 [file] [log] [blame] [edit]
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);
}