rust/src/test/compile-fail/regions-ref-in-fn-arg.rs
2013-11-26 08:19:00 -08:00

12 lines
271 B
Rust

fn arg_item(~ref x: ~int) -> &'static int {
x //~^ ERROR borrowed value does not live long enough
}
fn with<R>(f: |~int| -> R) -> R { f(~3) }
fn arg_closure() -> &'static int {
with(|~ref x| x) //~ ERROR borrowed value does not live long enough
}
fn main() {}