rust-lang / rust-lang/rust-analyzer

git dependencies not updating in analyzer after updating repository and doing "cargo update"

Open
#19,598 4 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

rust-analyzer version: rust-analyzer version: 0.3.2379-standalone (8365cf853e 2025-04-13)

rustc version: rustc 1.83.0 (90b35a623 2024-11-26)

editor or extension: VSCode, extension version 0.3.2379

relevant settings: nothing special AFAIK

repository link (if public, optional): Not public

I have a project that I'm working on that has a private repository that I'm using as a git dependency. Everything works fine until I update the private repository. I push a new version of the code to the private repository then cargo update [dependency] to download the new version to the project that depends on it, and confirm in my Cargo.lock that the new version is there.

The change I'm making in this scenario fixes an error that was showing up from rust-analyzer, and after doing the above steps the error is still there. cargo build works fine and shows no error but still doesn't update rust-analyzer. It's like rust-analyzer is using a cached version of the code that I can't locate.

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 report with a Rust project that uses a private git dependency: update the dependency repository, run cargo update, and compare Cargo.lock with rust-analyzer's diagnostics. Investigate how rust-analyzer refreshes git dependency sources and determine what refresh or cache invalidation makes the analyzer use the updated code; done means diagnostics reflect the new dependency while cargo build continues to succeed.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.