rust/src/test/run-pass/maybe-mutable.rs

16 lines
236 B
Rust
Raw Normal View History

// -*- rust -*-
fn len(v: [mutable? int]) -> uint {
2011-07-27 07:19:39 -05:00
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);
}