Diagnostic tweaks (review)

This commit is contained in:
Esteban Küber 2018-02-23 19:38:36 -08:00
parent 36baa81be9
commit d63d363ef9
4 changed files with 15 additions and 22 deletions

View file

@ -2,7 +2,9 @@ error: expected `{`, found `=>`
--> $DIR/missing-block-hint.rs:13:18
|
LL | if (foo) => {} //~ ERROR expected `{`, found `=>`
| ^^ help: only necessary in match arms, not before if blocks
| -- ^^
| |
| this `if` statement has a condition, but no block
error: expected `{`, found `bar`
--> $DIR/missing-block-hint.rs:17:13

View file

@ -14,7 +14,6 @@ fn main() {
&Some(2) => { 3 }
//~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
//~| NOTE expected one of `,`, `.`, `?`, `}`, or an operator here
//~^^^^ NOTE while parsing the match arm starting here
_ => 2
};
}

View file

@ -2,9 +2,7 @@ error: expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
--> $DIR/missing-comma-in-match.rs:14:18
|
13 | &None => 1
| -- - help: missing a comma here to end this match arm
| |
| while parsing the match arm starting here
| - help: missing a comma here to end this `match` arm
14 | &Some(2) => { 3 }
| ^^ expected one of `,`, `.`, `?`, `}`, or an operator here