Cargo Error: failed to get `X` as a dependency

Cargo Error: failed to get `X` as a dependency

我收到这个奇怪的错误:

cargo build
    Updating crates.io index
error: failed to get `anyhow` as a dependency of package `FlexDB v0.1.0 (E:\projects\FlexDB)`

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

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

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  missing delta bases; class=Indexer (15)

我的 cargo.toml 文件如下所示:

[package]
name = "FlexDB"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1"

我不知道该怎么办,我做了:

  1. rustup update
  2. 重启电脑

@kornel 回答确实解决了这个错误,

"It looks like your ~/.cargo/registry/index directory is corrupted. Delete it and run cargo update again."