diff options
| author | Konrad Borowski <konrad@borowski.pw> | 2020-03-22 20:02:29 +0100 |
|---|---|---|
| committer | Konrad Borowski <konrad@borowski.pw> | 2020-03-22 20:10:32 +0100 |
| commit | 4582c14bd48c74521e549fafc1e4a7d30e2b7b85 (patch) | |
| tree | 1591a3b38c1b5126478a9d3802171d10a8948d13 /src/libcore | |
| parent | 1902d1e0de179498d0cb7fd4856d1e0ffcd52095 (diff) | |
| download | rust-4582c14bd48c74521e549fafc1e4a7d30e2b7b85.tar.gz rust-4582c14bd48c74521e549fafc1e4a7d30e2b7b85.zip | |
Implement Hash for Infallible
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/convert/mod.rs | 8 |
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 {} + } +} |
