summary refs log tree commit diff
path: root/src/test/ui/issues/issue-52213.rs
blob: c4ce4946b2e28f6f7f4c6f80e0e49034712bd06e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
    match (&t,) { //~ ERROR cannot infer an appropriate lifetime
        ((u,),) => u,
    }
}

fn main() {
    let x = {
        let y = Box::new((42,));
        transmute_lifetime(&y)
    };

    println!("{}", x);
}