Closed
Description
Given this program:
use std;
fn main() {
let a = {mutable foo: [mutable 1u]};
vec::iteri(a.foo) {|i, v|
#error("%u = %u", i, v);
}
}
The error produced is: "m.rs:5:19: 7:2 error: argument 1 may alias with argument 0, which is not immutably rooted", which is more than a little jargon-y. If this is really an error, then it should be easier to understand what the problem is. Note that this program compiles cleanly:
use std;
fn main() {
let a = {mutable foo: [mutable 1u]};
let f = a.foo; // add a temp
vec::iteri(f) {|i, v|
#error("%u = %u", i, v);
}
}
Metadata
Metadata
Assignees
Labels
No labels