]>
Commit | Line | Data |
---|---|---|
04454e1e FG |
1 | // revisions: base nll |
2 | // ignore-compare-mode-nll | |
3 | //[nll] compile-flags: -Z borrowck=mir | |
4 | ||
85aaf69f | 5 | struct Invariant<'a> { |
dc9dc135 | 6 | f: Box<dyn FnOnce() -> *mut &'a isize + 'static>, |
223e47cc LB |
7 | } |
8 | ||
85aaf69f SL |
9 | fn to_same_lifetime<'r>(b_isize: Invariant<'r>) { |
10 | let bj: Invariant<'r> = b_isize; | |
223e47cc LB |
11 | } |
12 | ||
85aaf69f | 13 | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { |
04454e1e FG |
14 | b_isize |
15 | //[base]~^ ERROR mismatched types | |
16 | //[nll]~^^ ERROR lifetime may not live long enough | |
223e47cc LB |
17 | } |
18 | ||
19 | fn main() { | |
20 | } |