Auto merge of #4976 - mbrubeck:doc-check, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 5 Feb 2018 21:22:16 +0000 (21:22 +0000)
committerbors <bors@rust-lang.org>
Mon, 5 Feb 2018 21:22:16 +0000 (21:22 +0000)
commit16ffc053a8839ec3ef4325991900d33ec3f1521f
tree4471da8ab9a632596c0f76fca842722698b8222f
parentdf089f4e66c0e691c2a8ec5c7680a73b2d8f45af
parent9bb9dbd3c331486a7663602097141356c82c13f4
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