rust-lang / rust-lang/rust-analyzer

FP `non-exhaustive pattern: `_` not covered` recursive RPIT

Open
#22,987 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

fn rpit<'a: 'b, 'b: 'a>() -> impl Sized {
    let () = rpit::<'b, 'a>();
}
fn main() {}

this compiles with rustc but RA diagnostics show an error here

at crate ra, file /tmp/ra/src/main.rs: Error RustcHardError("E0005") from LineCol { line: 1, col: 8 } to LineCol { line: 1, col: 10 }: non-exhaustive pattern: `_` 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.

Research direction

Start by reproducing the example in /tmp/ra/src/main.rs and compare rustc's result with rust-analyzer diagnostics. Trace how the recursive RPIT pattern is analyzed and verify that rust-analyzer no longer reports E0005 when rustc accepts the code.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.