aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/maybe-mutable.rs
blob: b859ae7c4641f2889c2a428147ee3cdecf3813f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// xfail-boot
// -*- rust -*-

fn len(vec[mutable? int] v) -> uint {
    auto i = 0u;
    for (int x in v) {
        i += 1u;
    }
    ret i;
}

fn main() {
    auto v0 = vec(1, 2, 3, 4, 5);
    log len(v0);
    auto v1 = vec(mutable 1, 2, 3, 4, 5);
    log len(v1);
}