aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/maybe-mutable.rs
blob: c0af0867faa5af26e98562ad11a535b28e6772d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// -*- 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);
}