From: bors Date: Fri, 27 Apr 2018 17:48:52 +0000 (+0000) Subject: Auto merge of #5415 - alexcrichton:rename-same-dep, r=matklad X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~1^2~42 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3b14988d423b1858252ee05c5395abd035bbea5f;p=cargo.git Auto merge of #5415 - alexcrichton:rename-same-dep, r=matklad Fix renaming crates as they come from 2 sources Previously there was a verification in manifest parsing that the same dependency must come from the same source, but this erroneously triggered an error to get emitted when the `package` key was used to rename crates. The first change here was to update that clause to key off the `rename` field rather than the `name` field. Afterwards, though, this exposed an existing bug in the implementation. During compilation we have a `Resolve` which is a graph of crates, but we don't know *why* each edge in the dependency graph exists. In other words we don't know, when looking at an edge of the graph, what `Dependency` caused that edge to be drawn. We need to know this when passing `--extern` flags because the `Dependency` is what lists what's being renamed. This commit then primarily refactors `Resolve::deps` from an iterator of package ids to an iterator of a tuples. The first element is the package id from before and the second element is a list of `Dependency` directives which caused the edge to ber driven. This refactoring cleaned up a few places in the backend where we had to work around the lack of this knowledge. Namely this also fixes the extra test added here. Closes #5413 --- 3b14988d423b1858252ee05c5395abd035bbea5f