rust/src/test/run-pass/regions-infer-borrow-scope-view.rs
2012-07-14 17:37:32 -07:00

10 lines
159 B
Rust

fn view<T>(x: &[T]) -> &[T] {x}
fn main() {
let v = ~[1, 2, 3];
let x = view(v);
let y = view(x);
assert (v[0] == x[0]) && (v[0] == y[0]);
}