]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/issue-67007-escaping-data.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / nll / issue-67007-escaping-data.rs
CommitLineData
c295e0f8
XL
1// Regression test for issue #67007
2// Ensures that we show information about the specific regions involved
3
c295e0f8
XL
4// Covariant over 'a, invariant over 'tcx
5struct FnCtxt<'a, 'tcx: 'a>(&'a (), *mut &'tcx ());
6
7impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
8 fn use_it(&self, _: &'tcx ()) {}
9}
10
11struct Consumer<'tcx>(&'tcx ());
12
13impl<'tcx> Consumer<'tcx> {
14 fn bad_method<'a>(&self, fcx: &FnCtxt<'a, 'tcx>) {
5099ac24 15 let other = self.use_fcx(fcx); //~ ERROR lifetime may not live long enough
c295e0f8
XL
16 fcx.use_it(other);
17 }
18
19 fn use_fcx<'a>(&self, _: &FnCtxt<'a, 'tcx>) -> &'a () {
20 &()
21 }
22}
23
24fn main() {}