rust/src/test/run-pass/regions-infer-borrow-scope-view.rs

10 lines
163 B
Rust
Raw Normal View History

fn view<T>(x: &r/[T]) -> &r/[T] {x}
2012-07-06 11:14:57 -05:00
fn main() {
let v = ~[1, 2, 3];
let x = view(v);
let y = view(x);
assert (v[0] == x[0]) && (v[0] == y[0]);
}