]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / closure-requirements / region-lbr1-does-not-outlive-ebr2.rs
1 // Basic test for free regions in the NLL code. This test ought to
2 // report an error due to a reborrowing constraint. Right now, we get
3 // a variety of errors from the older, AST-based machinery (notably
4 // borrowck), and then we get the NLL error at the end.
5
6 // compile-flags:-Zverbose
7
8 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
9 &*x
10 //~^ ERROR lifetime may not live long enough
11 }
12
13 fn main() {}