]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/issue-52213.rs
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / issue-52213.rs
1 fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
2     match (&t,) {
3         ((u,),) => u,
4         //~^ ERROR lifetime may not live long enough
5     }
6 }
7
8 fn main() {
9     let x = {
10         let y = Box::new((42,));
11         transmute_lifetime(&y)
12     };
13
14     println!("{}", x);
15 }