rust/src/test/compile-fail/regions-borrow.rs

9 lines
143 B
Rust

fn foo(x: &uint) -> &uint { x }
fn main() {
let p = @3u;
let r = foo(p);
assert *p == *r;
//!^ ERROR reference is not valid
}