Closed
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
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTCategory: An issue proposing an enhancement or a PR with one.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.Working group: Diagnostics