rust-lang / rust-lang/rust-analyzer

Match arm assist is confused by use Enum::*

Open
#4,749 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-assists A-pattern E-unknown S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Match arm assist incorrectly detects missing match arms when enum members have multiple ways to be referenced (I suppose):
bug_match_arms

Code from repro:

enum Foo {
    Bar
}
use Foo::*;

fn main() {
    match Foo::Bar {
        Foo::Bar => {}
    }
}

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.

Research direction

Start by running the supplied Rust reproduction in rust-analyzer and locating the match arm assist behavior it exercises. Confirm the assist does not report a missing arm when an enum variant is referenced through both Foo::Bar and use Foo::*; no specific source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.