Skip to content

Commit 591634d

Browse files
committed
remove env::var from util::rustc::rustc_fingerprint
1 parent 67c64c0 commit 591634d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cargo/util/rustc.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ impl Rustc {
5353
&path,
5454
rustup_rustc,
5555
cache_location,
56+
config,
5657
);
5758

5859
let mut cmd = ProcessBuilder::new(&path);
@@ -174,10 +175,11 @@ impl Cache {
174175
rustc: &Path,
175176
rustup_rustc: &Path,
176177
cache_location: Option<PathBuf>,
178+
config: &Config,
177179
) -> Cache {
178180
match (
179181
cache_location,
180-
rustc_fingerprint(wrapper, workspace_wrapper, rustc, rustup_rustc),
182+
rustc_fingerprint(wrapper, workspace_wrapper, rustc, rustup_rustc, config),
181183
) {
182184
(Some(cache_location), Ok(rustc_fingerprint)) => {
183185
let empty = CacheData {
@@ -297,6 +299,7 @@ fn rustc_fingerprint(
297299
workspace_wrapper: Option<&Path>,
298300
rustc: &Path,
299301
rustup_rustc: &Path,
302+
config: &Config,
300303
) -> CargoResult<u64> {
301304
let mut hasher = StableHasher::new();
302305

@@ -330,8 +333,8 @@ fn rustc_fingerprint(
330333
let maybe_rustup = rustup_rustc == rustc;
331334
match (
332335
maybe_rustup,
333-
env::var("RUSTUP_HOME"),
334-
env::var("RUSTUP_TOOLCHAIN"),
336+
config.get_env("RUSTUP_HOME"),
337+
config.get_env("RUSTUP_TOOLCHAIN"),
335338
) {
336339
(_, Ok(rustup_home), Ok(rustup_toolchain)) => {
337340
debug!("adding rustup info to rustc fingerprint");

0 commit comments

Comments
 (0)