]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
abe05a73
XL
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.
5bcae85e 5
923072b8 6// compile-flags:-Zverbose
5bcae85e 7
abe05a73
XL
8fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
9 &*x
9fa01778 10 //~^ ERROR lifetime may not live long enough
5bcae85e 11}
a7813a04 12
9fa01778 13fn main() {}