about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJethro Beekman <jethro@fortanix.com>2019-04-26 12:45:26 -0700
committerJethro Beekman <jethro@fortanix.com>2019-04-29 09:16:23 -0700
commit24d89e5016d269637712e9b3806f07234d59a650 (patch)
tree6d077da4bfcbc4cc59b5b9440d87a0d31e72e855
parent597f432489f12a3f33419daa039ccef11a12c4fd (diff)
downloadrust-24d89e5016d269637712e9b3806f07234d59a650.tar.gz
rust-24d89e5016d269637712e9b3806f07234d59a650.zip
impl From<Infallible> for TryFromSliceError
-rw-r--r--src/libcore/array.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libcore/array.rs b/src/libcore/array.rs
index fb9c99f667d..50b3ef47790 100644
--- a/src/libcore/array.rs
+++ b/src/libcore/array.rs
@@ -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 @@ impl TryFromSliceError {
     }
 }
 
+#[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 }