rust/src/test/compile-fail/regions-escape-into-other-fn.rs

8 lines
146 B
Rust
Raw Normal View History

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