diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 86f4e7b48dab5..99b41360b0d00 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1364,13 +1364,8 @@ pub fn build_session( } let loader = file_loader.unwrap_or_else(|| Box::new(RealFileLoader)); - let hash_kind = sopts.unstable_opts.src_hash_algorithm.unwrap_or_else(|| { - if target_cfg.is_like_msvc { - SourceFileHashAlgorithm::Sha256 - } else { - SourceFileHashAlgorithm::Md5 - } - }); + let hash_kind = + sopts.unstable_opts.src_hash_algorithm.unwrap_or(SourceFileHashAlgorithm::Sha256); let source_map = Lrc::new(SourceMap::with_file_loader_and_hash_kind( loader, sopts.file_path_mapping(), diff --git a/compiler/rustc_span/src/source_map.rs b/compiler/rustc_span/src/source_map.rs index 0b575c13adf2a..5aa55026a2519 100644 --- a/compiler/rustc_span/src/source_map.rs +++ b/compiler/rustc_span/src/source_map.rs @@ -228,7 +228,7 @@ impl SourceMap { Self::with_file_loader_and_hash_kind( Box::new(RealFileLoader), path_mapping, - SourceFileHashAlgorithm::Md5, + SourceFileHashAlgorithm::Sha256, ) }