rust/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs
2019-05-29 00:57:31 -04:00

15 lines
300 B
Rust

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 mismatched types
}
fn main() {
}