Auto merge of #5461 - matklad:meta-rename, r=alexcrichton
Support crate renames in `cargo metadata`
This adds information about (currently unstable) crate renames to metadata. Unfortunately, we already expose dependencies as a list of package ids (which are strings), so we can't easily add a `rename` field easily. For this reason, I've added a parallel `deps` key, which basically deprecates `dependencies` field.
So, the new format looks like this
```JavaScript
{
"dependencies": [
"bar 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)"
],
"deps": [
{
"extern_crate_name": "baz", // this one is actually renamed
"id": "bar 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)"
},
{
"extern_crate_name": "bar",
"id": "bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)"
}
],
"features": [],
"id": "foo 0.5.0 (path+file://[..])"
},
```
Questions:
* Is there a better name for `extern_crate_name`? This name is precise, but it's longer than I like, and might become opaque in meaning if we remove `extern crate` from the language :)
* Should we feature gate this (i.e, only produce `deps` if we have a feature in `Cargo.toml`)? I think the answer is yes, but that'll require threading `Features` to `Workspace`...
r? @alexcrichton