@@ -361,19 +361,19 @@ One possible approach for this:
361
361
name = " some-cli"
362
362
363
363
[dependencies ]
364
- clap = { version. from ["clap_complete", "clap_mangen"] }
364
+ clap = { from = [" clap_complete" , " clap_mangen" ] }
365
365
clap_complete = " 3.4"
366
366
clap_mangen = " 3.4"
367
367
```
368
368
When resolving the dependencies for ` some-cli ` ,
369
369
the resolver will not explicitly choose a version for ` clap ` but will continue resolving the graph.
370
- Upon completion, it will look to see what version of ` clap_complete ` was
370
+ Upon completion, it will look to see what instance of ` clap_complete ` was
371
371
resolved and act as if that was what was specified inside of the in-memory
372
372
` clap ` dependency.
373
373
374
- The packakge using ` version. from` must be a public dependency of the ` from ` package.
374
+ The packakge using ` from ` must be a public dependency of the ` from ` package.
375
375
In this case, ` clap ` must be a public dependency of ` clap_complete ` .
376
- If the different packages in ` version. from` do not agree on what the package
376
+ If the different packages in ` from ` do not agree on what the package
377
377
version should resolve to (clap 3.4 vs clap 4.0), then it is an error.
378
378
379
379
Compared to the resolver doing this implicitly
@@ -385,6 +385,9 @@ The downside is it feels like the declaration is backwards.
385
385
If you have one core crate (e.g. ` clap ` ) and many crates branching off (e.g. ` clap_complete ` , ` clap_mangen ` ),
386
386
it seems like those helper crates should have their version picked from ` clap ` .
387
387
388
+ Whether this should be specified across all sources (` from ` ) or per source (` registry.from ` , ` git.from ` , ` path.from ` ) will need to be worked out.
389
+ See [ rust-lang/cargo #6921 ] ( https://github.com/rust-lang/cargo/issues/6921 ) for an example of using this for git dependencies.
390
+
388
391
## Missing feature declaration check
389
392
390
393
It is easy for packages to accidentally rely on a dependency enabling a feature for them.
0 commit comments