Caused by:
0: failed to load source for dependency `[dependency]`
1: Unable to update registry `crates-io`
2: usage of sparse registries requires `-Z sparse-registry`
Once the root cause was known, the workaround is to disable the sparse protocol in ~/.cargo/config.toml.
I'm just opening this issue in case others run into the same problem. I don't see any way to pass cargo flags (-Z) to unused-features analyze. I would also suggest updating Anyhow errors to include the backtrace to make identifying issues like this easier.
When the Cargo registry sparse protocol is enabled as described here, unused-features generates an empty report.
The debug logs indicate:
A common fix for this issue is to delete
~/.cargo/registry/index
and retry, however this did not fix my issue.In order to see more details of the problem, I patched the Anyhow error message to display the backtrace.
This indicated the source of the problem.
Once the root cause was known, the workaround is to disable the sparse protocol in
~/.cargo/config.toml
.I'm just opening this issue in case others run into the same problem. I don't see any way to pass cargo flags (-Z) to
unused-features analyze
. I would also suggest updating Anyhow errors to include the backtrace to make identifying issues like this easier.