]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / closure-requirements / region-lbr-anon-does-not-outlive-static.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
ff7c6d11 8fn foo(x: &u32) -> &'static u32 {
abe05a73 9 &*x
3c0e092e 10 //~^ ERROR lifetime may not live long enough
5bcae85e 11}
a7813a04 12
abe05a73 13fn main() { }