rust/src/test/run-pass/mutable-alias-vec.rs
2011-09-12 12:49:00 +02:00

17 lines
221 B
Rust

// -*- rust -*-
use std;
fn grow(&v: [int]) { v += [1]; }
fn main() {
let v: [int] = [];
grow(v);
grow(v);
grow(v);
let len = std::vec::len::<int>(v);
log len;
assert (len == 3 as uint);
}