]>
Commit | Line | Data |
---|---|---|
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 |
5 | struct FnCtxt<'a, 'tcx: 'a>(&'a (), *mut &'tcx ()); | |
6 | ||
7 | impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |
8 | fn use_it(&self, _: &'tcx ()) {} | |
9 | } | |
10 | ||
11 | struct Consumer<'tcx>(&'tcx ()); | |
12 | ||
13 | impl<'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 | ||
24 | fn main() {} |