rust/src/test/run-pass/maybe-mutable.rs
2011-07-27 15:54:33 +02:00

16 lines
237 B
Rust

// -*- rust -*-
fn len(v: vec[mutable? int]) -> uint {
let i = 0u;
for x: int in v { i += 1u; }
ret i;
}
fn main() {
let v0 = [1, 2, 3, 4, 5];
log len(v0);
let v1 = [mutable 1, 2, 3, 4, 5];
log len(v1);
}