rust/src/test/compile-fail/regions-escape-bound-fn-2.rs
2012-08-26 15:56:16 -07:00

11 lines
193 B
Rust

fn with_int(f: fn(x: &int)) {
let x = 3;
f(&x);
}
fn main() {
let mut x = None;
//~^ ERROR reference is not valid outside of its lifetime
with_int(|y| x = Some(y));
}