Skip to content

Commit 5739a5c

Browse files
Rollup merge of #113707 - sivadeilra:user/ardavis/sha256, r=eholk
Use SHA256 source file checksums by default when targeting MSVC Currently, when targeting Windows (more specifically, the MSVC toolchain), Rust will use SHA1 source file checksums by default. SHA1 has been superseded by SHA256, and Microsoft recommends migrating to SHA256. As of Visual Studio 2022, MSVC defaults to SHA256. This change aligns Rust and MSVC. LLVM can already use SHA256 checksums, so this does not require any change to LLVM. MSVC docs on source file checksums: https://learn.microsoft.com/en-us/cpp/build/reference/zh?view=msvc-170
2 parents 311bf67 + fcdff63 commit 5739a5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_session/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ pub fn build_session(
14201420
let loader = file_loader.unwrap_or_else(|| Box::new(RealFileLoader));
14211421
let hash_kind = sopts.unstable_opts.src_hash_algorithm.unwrap_or_else(|| {
14221422
if target_cfg.is_like_msvc {
1423-
SourceFileHashAlgorithm::Sha1
1423+
SourceFileHashAlgorithm::Sha256
14241424
} else {
14251425
SourceFileHashAlgorithm::Md5
14261426
}

0 commit comments

Comments
 (0)