Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/core/compiler/build_runner/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ fn compute_metadata(
}
}

let c_metadata = UnitHash(c_metadata_hasher.finish());
let c_extra_filename = UnitHash(c_extra_filename_hasher.finish());
let c_metadata = UnitHash(Hasher::finish(&c_metadata_hasher));
let c_extra_filename = UnitHash(Hasher::finish(&c_extra_filename_hasher));
let unit_id = c_extra_filename;

let c_extra_filename = use_extra_filename.then_some(c_extra_filename);
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/compile_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ impl CompileTarget {
self.name.hash(&mut hasher);
}
}
hasher.finish()
Hasher::finish(&hasher)
}
}
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/fingerprint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ fn calculate_normal(
local: Mutex::new(local),
memoized_hash: Mutex::new(None),
metadata,
config: config.finish(),
config: Hasher::finish(&config),
compile_kind,
rustflags: extra_flags,
fs_status: FsStatus::Stale,
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ fn traverse_and_share(
.collect();
// Here, we have recursively traversed this unit's dependencies, and hashed them: we can
// finalize the dep hash.
let new_dep_hash = dep_hash.finish();
let new_dep_hash = Hasher::finish(&dep_hash);

// This is the key part of the sharing process: if the unit is a runtime dependency, whose
// target is the same as the host, we canonicalize the compile kind to `CompileKind::Host`.
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/util/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn to_hex(num: u64) -> String {
pub fn hash_u64<H: Hash>(hashable: H) -> u64 {
let mut hasher = StableHasher::new();
hashable.hash(&mut hasher);
hasher.finish()
Hasher::finish(&hasher)
}

pub fn hash_u64_file(mut file: &File) -> std::io::Result<u64> {
Expand All @@ -23,7 +23,7 @@ pub fn hash_u64_file(mut file: &File) -> std::io::Result<u64> {
}
hasher.write(&buf[..n]);
}
Ok(hasher.finish())
Ok(Hasher::finish(&hasher))
}

pub fn short_hash<H: Hash>(hashable: &H) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/util/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ fn rustc_fingerprint(
_ => (),
}

Ok(hasher.finish())
Ok(Hasher::finish(&hasher))
}

fn process_fingerprint(cmd: &ProcessBuilder, extra_fingerprint: u64) -> u64 {
Expand All @@ -391,5 +391,5 @@ fn process_fingerprint(cmd: &ProcessBuilder, extra_fingerprint: u64) -> u64 {
let mut env = cmd.get_envs().iter().collect::<Vec<_>>();
env.sort_unstable();
env.hash(&mut hasher);
hasher.finish()
Hasher::finish(&hasher)
}