Auto merge of #4976 - mbrubeck:doc-check, r=alexcrichton
cargo doc: Generate rmeta files for dependencies instead of compiling rlibs
This makes `cargo doc` require only metadata (`.rmeta` files) instead of compiled libraries (`.rlib` files) for dependencies. This makes `cargo doc` faster in cases where rlibs are not already built and/or metadata is already available.
Unfortunately, this is not a win for every workflow. In the case where the user has already compiled but has not generated metadata, it makes `cargo doc` do extra work. This is probably a common case, though tools like RLS and `cargo check` mean that many developers *will* have up-to-date metadata available.
It would become an unequivocal win if `cargo build` and `cargo check` re-used shared metadata (#3501). For now, starting from a clean working directory, the following sequences of commands will become:
* `cargo doc`: faster
* `cargo build; cargo doc`: slower
* `cargo check; cargo doc`: faster
* `cargo build --release; cargo doc`: faster
* `cargo check; cargo build; cargo doc`: no change