Skip to content

Commit 5419aa3

Browse files
committed
Auto 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 78f97c9 + fcdff63 commit 5419aa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_session/src/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ pub fn build_session(
14251425
let loader = file_loader.unwrap_or_else(|| Box::new(RealFileLoader));
14261426
let hash_kind = sopts.unstable_opts.src_hash_algorithm.unwrap_or_else(|| {
14271427
if target_cfg.is_like_msvc {
1428-
SourceFileHashAlgorithm::Sha1
1428+
SourceFileHashAlgorithm::Sha256
14291429
} else {
14301430
SourceFileHashAlgorithm::Md5
14311431
}

0 commit comments

Comments
 (0)