Auto merge of #36915 - jfirebaugh:E0308-split, r=nikomatsakis

Use a distinct error code for "if may be missing an else clause"

Introduce the possibility of assigning distinct error codes to the various origin types of E0308. Start by assigning E0317 for the "IfExpressionWithNoElse" case, and write a long diagnostic specific to this case.

Fixes #36596
This commit is contained in:
bors 2016-10-17 14:06:46 -07:00 committed by GitHub
commit e0111758eb
3 changed files with 28 additions and 6 deletions

View file

@ -10,7 +10,7 @@
fn main() {
let a = if true { true };
//~^ ERROR if may be missing an else clause
//~^ ERROR if may be missing an else clause [E0317]
//~| expected type `()`
//~| found type `bool`
//~| expected (), found bool