rust-lang / rust-lang/rust-analyzer

`rust-analyzer` refuses to show type error until I run `cargo clean`

Open
#16,595 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

I'm working on a rather large Rust codebase, and the rust-analyzer seems to not point out an obvious type error (when switching from one non-primitive struct to another, but does when I switch from the struct to something inherent, like String).

https://github.com/rust-lang/rust-analyzer/issues/4894 <- This issue discusses a similar problem, where unless the OP runs cargo clean, the errors do not show up. Is there a way to make this information more available or push a fix that fixes this? Best guess is something to do with indexing not picking up certain changes, but I'm new to Rust, and wouldn't know.

Cheers,
Thanks.

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 missing type diagnostic in a large Rust codebase, comparing rust-analyzer behavior before and after cargo clean. Read the related issue at rust-lang/rust-analyzer#4894 for similar symptoms. Done means either the diagnostic appears without cleaning or the indexing/invalidation limitation is clearly identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.