about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorKonrad Borowski <konrad@borowski.pw>2020-03-22 20:02:29 +0100
committerKonrad Borowski <konrad@borowski.pw>2020-03-22 20:10:32 +0100
commit4582c14bd48c74521e549fafc1e4a7d30e2b7b85 (patch)
tree1591a3b38c1b5126478a9d3802171d10a8948d13 /src/libcore
parent1902d1e0de179498d0cb7fd4856d1e0ffcd52095 (diff)
downloadrust-4582c14bd48c74521e549fafc1e4a7d30e2b7b85.tar.gz
rust-4582c14bd48c74521e549fafc1e4a7d30e2b7b85.zip
Implement Hash for Infallible
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/convert/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/convert/mod.rs b/src/libcore/convert/mod.rs
index 47ab8715cfa..eef9ee7cb00 100644
--- a/src/libcore/convert/mod.rs
+++ b/src/libcore/convert/mod.rs
@@ -41,6 +41,7 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use crate::fmt;
+use crate::hash::{Hash, Hasher};
 
 mod num;
 
@@ -746,3 +747,10 @@ impl From<!> for Infallible {
         x
     }
 }
+
+#[stable(feature = "convert_infallible_hash", since = "1.44.0")]
+impl Hash for Infallible {
+    fn hash<H: Hasher>(&self, _: &mut H) {
+        match *self {}
+    }
+}