rust-lang / rust-lang/rust-analyzer

"Fill match arms" code action creates non-exhaustive match

Open
#8,129 8 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.