-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an AST
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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an AST