Skip to content

Commit e41bdac

Browse files
committed
Auto merge of #116043 - saethlin:sha256-sourcefile, r=<try>
Default to sha256 for hashing source files r? `@ghost`
2 parents b3aa8e7 + b576384 commit e41bdac

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

compiler/rustc_session/src/session.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -1364,13 +1364,8 @@ pub fn build_session(
13641364
}
13651365

13661366
let loader = file_loader.unwrap_or_else(|| Box::new(RealFileLoader));
1367-
let hash_kind = sopts.unstable_opts.src_hash_algorithm.unwrap_or_else(|| {
1368-
if target_cfg.is_like_msvc {
1369-
SourceFileHashAlgorithm::Sha256
1370-
} else {
1371-
SourceFileHashAlgorithm::Md5
1372-
}
1373-
});
1367+
let hash_kind =
1368+
sopts.unstable_opts.src_hash_algorithm.unwrap_or(SourceFileHashAlgorithm::Sha256);
13741369
let source_map = Lrc::new(SourceMap::with_file_loader_and_hash_kind(
13751370
loader,
13761371
sopts.file_path_mapping(),

compiler/rustc_span/src/source_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl SourceMap {
228228
Self::with_file_loader_and_hash_kind(
229229
Box::new(RealFileLoader),
230230
path_mapping,
231-
SourceFileHashAlgorithm::Md5,
231+
SourceFileHashAlgorithm::Sha256,
232232
)
233233
}
234234

0 commit comments

Comments
 (0)