Skip to content

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

Description

@hniksic

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.

Metadata

Metadata

Labels

A-assistsA-patternpattern handling related thingsS-actionableSomeone could pick this issue up and work on it right now

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions