745c1ea438
``` 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
420 B
Rust
17 lines
420 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
|
|
};
|
|
}
|