rust/src/test/run-pass/maybe-mutable.rs
2011-11-16 13:52:08 -08:00

17 lines
231 B
Rust

// -*- rust -*-
fn len(v: [const 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);
}