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