I could not compile mdbook-toc v0.10.0 because it failed to import clap::crate_version with the following error message. The full build log is available here.
Compiling mdbook-toc v0.10.0
error[E0432]: unresolved import `clap::crate_version`
--> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-toc-0.10.0/src/bin/mdbook-toc.rs:6:12
|
6 | use clap::{crate_version, Arg, ArgMatches, Command};
| ^^^^^^^^^^^^^ no `crate_version` in the root
error: cannot determine resolution for the macro `crate_version`
--> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-toc-0.10.0/src/bin/mdbook-toc.rs:16:18
|
16 | .version(crate_version!())
| ^^^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
I think the problem is simply missing to include the feature flag in the Cargo.toml.
The doc of clap says that you need to enable the crate feature cargo to use clap::crate_version. I see it's currently missing in the Cargo.toml file of the project. We can confirm the feature cargo is not enabled by the default in their Cargo.toml.
I could not compile
mdbook-toc
v0.10.0 because it failed to importclap::crate_version
with the following error message. The full build log is available here.I think the problem is simply missing to include the feature flag in the
Cargo.toml
.The doc of
clap
says that you need to enable the crate featurecargo
to useclap::crate_version
. I see it's currently missing in theCargo.toml
file of the project. We can confirm the featurecargo
is not enabled by the default in their Cargo.toml.