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

16 lines
237 B
Rust
Raw Normal View History

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