-
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 ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics
Description
UPDATE: Mentoring instructions below.
Try compiling this code:
use std::io;
fn main(){
let x: io::IoResult<()> = Ok(());
match x {
Err(ref e) if e.kind == io::EndOfFile {
return
}
_ => {}
}
}
I (using Rust 0.11.0) get the very misleading message:
$ rustc match_syntax_err.rs
match_syntax_err.rs:7:13: 7:19 error: found `return` in ident position
match_syntax_err.rs:7 return
^~~~~~
match_syntax_err.rs:8:9: 8:10 error: expected `:` but found `}`
match_syntax_err.rs:8 }
when actually all that's wrong is a missing =>
. Not really a good brain teaser on a Friday evening ;)
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 ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics