os-rust/tests/ui/regions/regions-infer-invariance-due-to-mutability-4.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
322 B
Rust
Raw Normal View History

struct Invariant<'a> {
2019-05-28 14:46:13 -04:00
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
2022-04-01 13:13:25 -04:00
//~^ ERROR lifetime may not live long enough
}
fn main() {
}