Closed
Description
In this code:
fn foo() {
match Some(x) {
Some(y) { fail!(); }
None { fail!(); }
}
fn bar() {
let mut i = 0;
while (i < 1000) {}
}
fn main() {}
foo
is missing the close brace for the alt
, but the resulting parse error message is very unhelpful:
src/test/compile-fail/bad.rs:12:13: 12:13 error: unexpected token: '<eof>'
src/test/compile-fail/bad.rs:12 fn main() {}
^
It would be much more helpful to report the error at the location where the un-closed brace was (in this case, after the alt in foo
). I don't know how easy it would be to do with the current parser, though.