2015-01-08 04:54:35 -06:00
|
|
|
fn write(v: &mut [isize]) {
|
2012-09-11 23:25:01 -05:00
|
|
|
v[0] += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2016-10-29 16:54:04 -05:00
|
|
|
let v = vec![1, 2, 3];
|
2015-02-01 20:53:25 -06:00
|
|
|
write(&mut v); //~ ERROR cannot borrow
|
2012-09-11 23:25:01 -05:00
|
|
|
}
|