]> git.lizzy.rs Git - rust.git/commitdiff
impl From<Infallible> for TryFromSliceError
authorJethro Beekman <jethro@fortanix.com>
Fri, 26 Apr 2019 19:45:26 +0000 (12:45 -0700)
committerJethro Beekman <jethro@fortanix.com>
Mon, 29 Apr 2019 16:16:23 +0000 (09:16 -0700)
src/libcore/array.rs

index fb9c99f667df230310c8c79563bf26c0c5bbcddf..50b3ef477904a44ec3e46eea7313f2a23c023911 100644 (file)
@@ -11,7 +11,7 @@
 
 use crate::borrow::{Borrow, BorrowMut};
 use crate::cmp::Ordering;
-use crate::convert::TryFrom;
+use crate::convert::{Infallible, TryFrom};
 use crate::fmt;
 use crate::hash::{Hash, self};
 use crate::marker::Unsize;
@@ -72,6 +72,13 @@ pub fn __description(&self) -> &str {
     }
 }
 
+#[stable(feature = "try_from_slice_error", since = "1.36.0")]
+impl From<Infallible> for TryFromSliceError {
+    fn from(x: Infallible) -> TryFromSliceError {
+        match x {}
+    }
+}
+
 macro_rules! __impl_slice_eq1 {
     ($Lhs: ty, $Rhs: ty) => {
         __impl_slice_eq1! { $Lhs, $Rhs, Sized }