rust-lang / rust-lang/rust-analyzer
"Fill match arms" code action creates non-exhaustive match
Open
@ChayimFriedman2 is already working on this.
Since Aug 9, 2026.
A-assists
A-pattern
S-actionable
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I have code like this:
let mut chars = s.chars().peekable();
match chars.peek() {
Some(&'+') => {
chars.next();
}
Some(&'-') => {
bigint.negative = true;
chars.next();
}
_ => (),
}
Rust analyzer (run through Emacs) suggests the "fill match arms" action which, when applied, changes the fallback match arm to:
None => {}
However, that's incorrect because as the compiler points out, the patterns Some(&'\u{0}'..='*'), Some(&','), Some(&'.'..='\u{d7ff}') and 1 more not covered.
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.