about summary refs log tree commit diff
path: root/compiler/rustc_span/src/def_id.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-02-05 18:53:47 +0400
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-02-05 18:53:47 +0400
commitf4e2b954a1749bb215eb0f1365e7d1f95162d3ba (patch)
treebd2b0569731441d2cd30712f1ea2fe5ce6ad6b5f /compiler/rustc_span/src/def_id.rs
parentc60cc439858a028d8ecc2be1e7468c04cc36e8f2 (diff)
downloadrust-f4e2b954a1749bb215eb0f1365e7d1f95162d3ba.tar.gz
rust-f4e2b954a1749bb215eb0f1365e7d1f95162d3ba.zip
rustc_metadata: Encode/decode `DefPathHash`es without an `Option`
Diffstat (limited to 'compiler/rustc_span/src/def_id.rs')
-rw-r--r--compiler/rustc_span/src/def_id.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/def_id.rs b/compiler/rustc_span/src/def_id.rs
index 7c5e1427d1e..cdda052f529 100644
--- a/compiler/rustc_span/src/def_id.rs
+++ b/compiler/rustc_span/src/def_id.rs
@@ -119,6 +119,12 @@ impl DefPathHash {
     }
 }
 
+impl Default for DefPathHash {
+    fn default() -> Self {
+        DefPathHash(Fingerprint::ZERO)
+    }
+}
+
 impl Borrow<Fingerprint> for DefPathHash {
     #[inline]
     fn borrow(&self) -> &Fingerprint {