Annoying Rustc Messages - pnkfelix/rust GitHub Wiki

fn okay() {
    [1].map(|_x|2);
}
fn bad() {
    [1].map(|_x|2)
}

rustc helloworld.rs
helloworld.rs:305:4: 306:1 error: mismatched types: expected `()` but found `~[<VI1>]` (expected () but found vector)
helloworld.rs:305     [1].map(|_x|2)
helloworld.rs:306 }
error: aborting due to previous error

rustc could special case this scenario and suggest a missing semi-colon.

⚠️ **GitHub.com Fallback** ⚠️