rust/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs

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

15 lines
296 B
Rust
Raw Normal View History

struct Invariant<'a> {
2019-05-28 18:46:13 +00: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 //~ ERROR mismatched types
}
fn main() {
}