Missing arm should recommend adding an arm
Open
@jakubadamw is already working on this.
Since Jul 21, 2026.
A-diagnostics
A-parser
D-confusing
E-easy
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
fn matches(d: Option<u32>) {
match d {
Some(d) => {},
None,
}
}
Current output
Compiling playground v0.0.1 (/playground)
error: unexpected `,` in pattern
--> src/lib.rs:11:13
|
11 | None,
| ^
|
help: try adding parentheses to match on a tuple...
|
11 | (None,)
| + +
help: ...or a vertical bar to match on alternatives
|
11 - None,
11 + None |
|
error: could not compile `playground` (lib) due to 1 previous error
Desired output
Compiling playground v0.0.1 (/playground)
error: unexpected `,` in pattern, missing arm?
--> src/lib.rs:11:13
|
11 | None,
| ^
|
help: try adding an arm
|
11 | None => {},
| +++++
error: could not compile `playground` (lib) due to 1 previous error
Rationale and extra context
No response
Other cases
Rust Version
1.97.1 (current playground stable)
Anything else?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.