2013-01-24 21:33:48 -06:00
|
|
|
fn a() {
|
|
|
|
let mut vec = [~1, ~2, ~3];
|
|
|
|
match vec {
|
|
|
|
[~ref _a] => {
|
|
|
|
vec[0] = ~4; //~ ERROR prohibited due to outstanding loan
|
|
|
|
}
|
2013-02-11 21:26:38 -06:00
|
|
|
_ => fail!(~"foo")
|
2013-01-24 21:33:48 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn b() {
|
|
|
|
let mut vec = [~1, ~2, ~3];
|
|
|
|
match vec {
|
|
|
|
[.._b] => {
|
|
|
|
vec[0] = ~4; //~ ERROR prohibited due to outstanding loan
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|
|
|
|
|