Skip to content

Commit

Permalink
_cargo/config: enable sparse-registry
Browse files Browse the repository at this point in the history
[ERROR rust_analyzer::lsp_utils] rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/yous.zhouys/git-repo/.../Cargo.toml, Some(Version { major: 1, minor: 65, patch: 0, pre: Prerelease("nightly") }): Failed to run `"cargo" "metadata" "--format-version" "1" "--manifest-path" "/home/yous.zhouys/git-repo/.../Cargo.toml" "--filter-platform" "x86_64-unknown-linux-gnu"`: `cargo metadata` exited with an error: error: failed to get `anyhow` as a dependency of package `... v0.1.0 (/home/yous.zhouys/git-repo/...../.../...)`

Caused by:
  failed to load source for dependency `anyhow`

Caused by:
  Unable to update registry `crates-io`

Caused by:
  usage of sparse registries requires `-Z sparse-registry`
  • Loading branch information
yousong committed Apr 12, 2024
1 parent 479ec4e commit 776a2e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/_cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"

[source.rustcc]
registry = "git://crates.rustcc.cn/crates.io-index"

# https://doc.rust-lang.org/cargo/reference/unstable.html
[unstable]
sparse-registry = true

0 comments on commit 776a2e7

Please sign in to comment.