Skip to content

Commit 4582c14

Browse files
Implement Hash for Infallible
1 parent 1902d1e commit 4582c14

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libcore/convert/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#![stable(feature = "rust1", since = "1.0.0")]
4242

4343
use crate::fmt;
44+
use crate::hash::{Hash, Hasher};
4445

4546
mod num;
4647

@@ -746,3 +747,10 @@ impl From<!> for Infallible {
746747
x
747748
}
748749
}
750+
751+
#[stable(feature = "convert_infallible_hash", since = "1.44.0")]
752+
impl Hash for Infallible {
753+
fn hash<H: Hasher>(&self, _: &mut H) {
754+
match *self {}
755+
}
756+
}

0 commit comments

Comments
 (0)