2018-05-03 11:26:58 -07:00
|
|
|
//@ run-rustfix
|
|
|
|
|
|
Provide missing comma in match arm suggestion
When finding:
```rust
match &Some(3) {
&None => 1
&Some(2) => { 3 }
_ => 2
}
```
provide the following diagnostic:
```
error: expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
--> $DIR/missing-comma-in-match.rs:15:18
|
X | &None => 1
| -- - help: missing comma
| |
| while parsing the match arm starting here
X | &Some(2) => { 3 }
| ^^ expected one of `,`, `.`, `?`, `}`, or an operator here
```
2018-02-18 14:36:35 -08:00
|
|
|
fn main() {
|
|
|
|
|
match &Some(3) {
|
|
|
|
|
&None => 1
|
|
|
|
|
&Some(2) => { 3 }
|
|
|
|
|
//~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
|
2019-10-28 11:08:53 -07:00
|
|
|
//~| NOTE expected one of `,`, `.`, `?`, `}`, or an operator
|
Provide missing comma in match arm suggestion
When finding:
```rust
match &Some(3) {
&None => 1
&Some(2) => { 3 }
_ => 2
}
```
provide the following diagnostic:
```
error: expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
--> $DIR/missing-comma-in-match.rs:15:18
|
X | &None => 1
| -- - help: missing comma
| |
| while parsing the match arm starting here
X | &Some(2) => { 3 }
| ^^ expected one of `,`, `.`, `?`, `}`, or an operator here
```
2018-02-18 14:36:35 -08:00
|
|
|
_ => 2
|
|
|
|
|
};
|
|
|
|
|
}
|