Open
Description
Problem
When adding a new dependency that is meant to interact with another one (ie its a public transitive dependency), you need the versions aligned.
Proposed Solution
When cargo add foo
auto-selects the version requirement, we shouldn't just check other dependency tables to see if the dependency is present but we should first check public transitive dependencies of the table we are editing.
We also should check the public dependencies of the package being added to see if there is a better match
ie in the ideal case we would allow either of the following
$ cargo add clap_complete@3
$ cargo add clap # pick v3 instead of v4
$ ...
$ cargo add clap@3
$ cargo add clap_complete # pick v3 instead of v4
How well it works in practice, it will be seen.
Notes
No response