mirror of
https://github.com/rust-lang/rust.git
synced 2026-01-21 03:30:39 +00:00
```
error: expected one of `,`, `:`, or `}`, found `.`
--> $DIR/missing-fat-arrow.rs:25:14
|
LL | Some(a) if a.value == b {
| - while parsing this struct
LL | a.value = 1;
| -^ expected one of `,`, `:`, or `}`
| |
| while parsing this struct field
|
help: try naming a field
|
LL | a: a.value = 1;
| ++
help: you might have meant to start a match arm after the match guard
|
LL | Some(a) if a.value == b => {
| ++
```
Fix #78585.
17 lines
421 B
Rust
17 lines
421 B
Rust
// Regression test for issue #89396: Try to recover from a
|
|
// `=>` -> `=` or `->` typo in a match arm.
|
|
|
|
// run-rustfix
|
|
|
|
fn main() {
|
|
let opt = Some(42);
|
|
let _ = match opt {
|
|
Some(_) => true,
|
|
//~^ ERROR: expected one of
|
|
//~| HELP: use a fat arrow to start a match arm
|
|
None => false,
|
|
//~^ ERROR: expected one of
|
|
//~| HELP: use a fat arrow to start a match arm
|
|
};
|
|
}
|