Auto merge of #4852 - jtgeibel:cargo-install-target-dir, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 22 Dec 2017 16:55:35 +0000 (16:55 +0000)
committerbors <bors@rust-lang.org>
Fri, 22 Dec 2017 16:55:35 +0000 (16:55 +0000)
Always respect `CARGO_TARGET_DIR` during `cargo install`

This aligns the behavior of crates.io and `--git` sources with that of `--path`
regarding the `CARGO_TARGET_DIR` and `CARGO_BUILD_TARGET_DIR` environment
variables.  If neither environment variable is set, then a temporary directory
is still used when installing from crates.io or `--git`.

As discussed in #4725, this can be used to enable caching of artifacts between
continuous integration builds.

/cc @alexcrichton, @ishanjain28


Trivial merge