rust/src/test/compile-fail/regions-escape-bound-fn.rs
2012-08-20 22:00:06 -07:00

10 lines
163 B
Rust

fn with_int(f: fn(x: &int)) {
let x = 3;
f(&x);
}
fn main() {
let mut x: option<&int> = none; //~ ERROR cannot infer
with_int(|y| x = some(y));
}