PageRenderTime 13ms CodeModel.GetById 6ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/jruderman/rust
Rust | 16 lines | 11 code | 4 blank | 1 comment | 1 complexity | 779bfa8852a44a04e9d77a3c14a3dd7b MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5fn len(v: ~[const int]) -> uint {
 6    let mut i = 0u;
 7    while i < vec::len(v) { i += 1u; }
 8    return i;
 9}
10
11fn main() {
12    let v0 = ~[1, 2, 3, 4, 5];
13    log(debug, len(v0));
14    let v1 = ~[mut 1, 2, 3, 4, 5];
15    log(debug, len(v1));
16}