]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/convert/mod.rs
Tweak "non-primitive cast" error
[rust.git] / src / libcore / convert / mod.rs
index 47ab8715cfa14b0aea2a8c396a7afdc30701aa41..8ff1ced53b071840f45edad5e3c3184804fb90c2 100644 (file)
@@ -41,6 +41,7 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use crate::fmt;
+use crate::hash::{Hash, Hasher};
 
 mod num;
 
@@ -373,6 +374,7 @@ pub trait Into<T>: Sized {
 /// [`Into`]: trait.Into.html
 /// [`from`]: trait.From.html#tymethod.from
 /// [book]: ../../book/ch09-00-error-handling.html
+#[rustc_diagnostic_item = "from_trait"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_on_unimplemented(on(
     all(_Self = "&str", T = "std::string::String"),
@@ -746,3 +748,10 @@ fn from(x: !) -> Self {
         x
     }
 }
+
+#[stable(feature = "convert_infallible_hash", since = "1.44.0")]
+impl Hash for Infallible {
+    fn hash<H: Hasher>(&self, _: &mut H) {
+        match *self {}
+    }
+}