Adding
[lints.clippy]
cargo = { priority = -1, level = "deny" }
to Cargo.toml will also turn on the multiple_crate_versions rule.
It will them complain if the same create was added more than once (with different version numbers) to Cargo.lock.
How could this happen?
What to do about it?
- We can decide to disregard this rule. Add the following line to
Cargo.toml
[lints.clippy]
multiple_crate_versions = "allow"
- Tell Clippy about the specific crates for which we allow the duplication:
Create the clippy.toml file and add the following entry, with the names of the crates we allow to be duplicated:
allowed-duplicate-crates = [
"async-channel",
"event-listener",
"foldhash",
"hashbrown",
"hashlink",
"wit-bindgen",
]
-
Figure out which of our dependencies brought in these dependencies and either replace our own dependencies, or send a Pull-Request to our dependencies to allow for more flexibility.