rust-lang / rust-lang/rust-analyzer

Updating crates.io index after every `cargo clean`

Open
#20,143 3 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 0.3.2509-standalone
(also reproduced in later versions, including nightly)

rustc version: rustc 1.88.0 (6b00bc388 2025-06-23), rustc 1.87.0 (17067e9ac 2025-05-09)

editor or extension: neovim v0.11.2, default rust analyzer settings

code snippet to reproduce:

# Create new project
cargo init sample
cd sample

# run editor
nvim src/main.rs

Rust analyzer starts to show status "updating crates.io index". After sometime message "cargo metadata: ?" also appears. It blocks if there is no connection to the Internet.

On the other hand I can simply run cargo clean && cargo metadata without connection to the Internet.

Also I tried to set rust-analyzer.cargo.noDeps: true and rust-analyzer.cargo.autoreload: true, this does not solve the problem.

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

Reproduce the behavior with the listed cargo init, nvim, cargo clean, and cargo metadata commands, including without an Internet connection. Trace the rust-analyzer cargo metadata flow that reports "updating crates.io index" after startup or cleanup; done means opening the project no longer unnecessarily blocks on index updates when offline.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.