blob: c1fb41bd9170b6bf0f12caafb3621beed0f90e97 [file] [log] [blame] [edit]
struct Invariant<'a> {
f: Box<dyn FnOnce(&mut &'a isize) + 'static>,
}
fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {
let bj: Invariant<'r> = b_isize;
}
fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
b_isize
//~^ ERROR lifetime may not live long enough
}
fn main() {
}