summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-mut-slice-of-imm-vec.rs
blob: 8e23571cedcdd3f1e57b2f346040d9c2123e2544 (plain)
1
2
3
4
5
6
7
8
fn write(v: &mut [isize]) {
    v[0] += 1;
}

fn main() {
    let v = vec![1, 2, 3];
    write(&mut v); //~ ERROR cannot borrow
}