about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-11-03 19:32:26 +0100
committerGitHub <noreply@github.com>2020-11-03 19:32:26 +0100
commit52405f7c0cc3e8cc52293ea19b78da88eb79af2d (patch)
tree9278e073fba56162eb4f1cfe06cf1763ddcc2e83 /compiler/rustc_codegen_llvm/src/debuginfo
parent0cd1516696550e108863bf4b4fb81ce5c4f58968 (diff)
parent3296d5ca7b41154359eaec76d9f77310816c9913 (diff)
downloadrust-52405f7c0cc3e8cc52293ea19b78da88eb79af2d.tar.gz
rust-52405f7c0cc3e8cc52293ea19b78da88eb79af2d.zip
Rollup merge of #77950 - arlosi:sha256, r=eddyb
Add support for SHA256 source file hashing

Adds support for `-Z src-hash-algorithm sha256`, which became available in LLVM 11.

Using an older version of LLVM will cause an error `invalid checksum kind` if the hash algorithm is set to sha256.

r? `@eddyb`
cc #70401 `@est31`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 73c1f73ec7f..ef1ae807453 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -801,6 +801,7 @@ fn file_metadata_raw(
                     let kind = match hash.kind {
                         rustc_span::SourceFileHashAlgorithm::Md5 => llvm::ChecksumKind::MD5,
                         rustc_span::SourceFileHashAlgorithm::Sha1 => llvm::ChecksumKind::SHA1,
+                        rustc_span::SourceFileHashAlgorithm::Sha256 => llvm::ChecksumKind::SHA256,
                     };
                     (kind, hex_encode(hash.hash_bytes()))
                 }