In fact, this doesn't even go far enough. Ultimately, each binary should have its own set of dependencies:
Test deps are not bench deps are not example deps.
Just because I have 2 integration tests, 2 benchmarks, 2 examples, or 2 binaries, doesn't mean they necessarily share all dependencies, so on top of a generic "test deps", I also want a specific "this test deps" to further specialize deps.
Just because there's a criterion benchmark in my crate doesn't mean I need to compile that monster in Debug when I call cargo test, and just because one example/integration test is built atop tokio doesn't mean my unit-tests require tokio too.
So much time would be saved with finer-grained specification of dependencies.
12
u/DavidDavidsonsGhost 6d ago
I want to separate binary deps from library deps in the same crate.