rust/src/test/run-pass/regions-infer-borrow-scope-within-loop-ok.rs

11 lines
142 B
Rust

fn borrow<T>(x: &r/T) -> &r/T {x}
fn main() {
let x = @3;
loop {
let y = borrow(x);
assert *x == *y;
break;
}
}