You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#137409 - estebank:match-arm, r=compiler-errors
Tweak comma handling of "missing match arm" suggestion and fix "remove this arm" suggestion, and make suggestion verbose
Better track trailing commas in match arms. Do not suggest adding trailing comma to match arm with block body. Better heuristic for "is this match in one line".
When encountering an unreachable match arm, (correctly) suggest removing the entire arm:
```
error: a never pattern is always unreachable
--> $DIR/ICE-130779-never-arm-no-oatherwise-block.rs:10:20
|
LL | ! if true => {}
| ^^ this will never be executed
|
help: remove the unreachable match arm
|
LL - ! if true => {}
|
```
Noticed in rust-lang#137343 (comment).
r? `@compiler-errors`
The first commit is independent of the second, but to make the second one produce accurate suggestions the span needs to include the trailing comma, hence the grouping of both changes in this PR.
0 commit comments