Closed
Description
I don't know if it's fixable, but it would be nice if the ... || {}
syntax created an error when it doesn't make sense (or does it and I am confused?)
To reproduce, try to compile:
fn main() {
let test = [0, 1];
test.iter().advance |val| {
println(arg);
}
}
As you see for
is missing at line 3, but the compiler reports:
test.rs:3:25: 3:28 error: unresolved name `val`. Did you mean `test`?
test.rs:3 test.iter().advance |val| {
^~~
test.rs:4:16: 4:19 error: unresolved name `arg`. Did you mean `test`?
test.rs:4 println(arg);
^~~
Which is very misleading.