summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-52213.rs
blob: a016924a869a8c09f082247b0c8726a6831ac109 (plain)
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);
}