2015-01-12 10:27:25 -05:00
|
|
|
struct Invariant<'a> {
|
2019-05-28 14:46:13 -04:00
|
|
|
f: Box<dyn FnOnce() -> *mut &'a isize + 'static>,
|
2012-08-09 09:59:50 -07:00
|
|
|
}
|
|
|
|
|
2015-02-18 05:42:01 -05:00
|
|
|
fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {
|
|
|
|
let bj: Invariant<'r> = b_isize;
|
2012-08-09 09:59:50 -07:00
|
|
|
}
|
|
|
|
|
2015-02-18 05:42:01 -05:00
|
|
|
fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
|
2022-04-19 12:56:18 +02:00
|
|
|
b_isize
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2012-08-09 09:59:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2013-02-14 11:47:00 -08:00
|
|
|
}
|