Lately we've been hitting a lot of problems where rustc picks the wrong version of a crate from multiple candidates. Sometimes this happens from picking the 0.1 crate when it should pick 0.2, sometimes because there are multiple 0.2 crates and it picks the wrong one randomly.
There are two parts to this solution. This first is just being more disciplined about our use statements (#2069).
The second part involves adding a check to creader that there is only a single match. When there are multiple matching crates it will list them and their associated linkage metadata then error. In order to recover from the error the code must create more specific use statements until there is no ambiguity.
This leaves an open problem when there are two matching crates with the same linkage metadata. Usually in this case you just want do delete the old ones, but we could also allow use to match on the crate hash itself.
Lately we've been hitting a lot of problems where rustc picks the wrong version of a crate from multiple candidates. Sometimes this happens from picking the 0.1 crate when it should pick 0.2, sometimes because there are multiple 0.2 crates and it picks the wrong one randomly.
There are two parts to this solution. This first is just being more disciplined about our
usestatements (#2069).The second part involves adding a check to creader that there is only a single match. When there are multiple matching crates it will list them and their associated linkage metadata then error. In order to recover from the error the code must create more specific
usestatements until there is no ambiguity.This leaves an open problem when there are two matching crates with the same linkage metadata. Usually in this case you just want do delete the old ones, but we could also allow
useto match on the crate hash itself.