I disagree — the point is not about having an alternative repository with an identical set of crates, but an alternative repository which can make its own decisions about which crates to allow, who owns which crate, and maybe even publish their own patches.
Say we had an alternative repository, greatcrates.net, which our hypothetical user wants to use. Say we have some dependencies:
-
bloom, only published by greatcrates.net, depending on petal 1.1.5
-
flower, published by crates.io and greatcrates.net, depending on petal 1.1
-
petal, published on both but with version 1.1.5 only available on greatcrates.net
Now, bloom only has a single source and though flower has two, both have an identical version, so a checksum is enough to deduplicate. But petal has two different versions available, so what does Cargo do? Including both is redundant and may cause issues if the lib has internal state. Using the older version from crates.io is apparently incompatible. Using the newer version from greatcrates.net may be fine, but since flower depended on the original publication on crates.io we can’t know this.
It is questionable whether simply enabling an extra repository should automatically pull in newer versions of packages available from that source — especially since a user might enable the repository with the intention to use only a single package. So foo = "0.2" should not simply mean look for foo, version 0.2, in all repositories.
One possibility might be that dependencies are always namespaced by the repository, but that crates may have a provides name with alternative names for the same lib. Going back to our petal example, greatcrates.net/petal could have provides = ["petal"] (assuming no namespace is required for crates.io), which tells Cargo that using greatcrates.net/petal is a drop-in replacement for crates.io's petal, thus safely de-duplicating dependencies.
(Note that as well as allowing each repo to have its own namespace, repos could also have caches, republishing crates directly from other repos. Ultimately, it must be up to the user which repos to trust.)