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

I am getting this weird error:

cargo build
    Updating 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 ``

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

My cargo.toml file look like this:

name = "FlexDB"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at

anyhow = "1"

I don't know what to do, I did:

  1. rustup update
  2. Restart computer


  • @kornel answer did solved this error,

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