summaryrefslogtreecommitdiffstats
path: root/src/test/ui/array-slice-vec/mutable-alias-vec.rs
blob: 98dd46824fa6ed3b2dc6112fec057fdbc552b05c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass

fn grow(v: &mut Vec<isize> ) {
    v.push(1);
}

pub fn main() {
    let mut v: Vec<isize> = Vec::new();
    grow(&mut v);
    grow(&mut v);
    grow(&mut v);
    let len = v.len();
    println!("{}", len);
    assert_eq!(len, 3 as usize);
}