about summary refs log tree commit diff
path: root/src/libcore/array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/array.rs')
-rw-r--r--src/libcore/array.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libcore/array.rs b/src/libcore/array.rs
index 5f222e249ea..3d13a84e232 100644
--- a/src/libcore/array.rs
+++ b/src/libcore/array.rs
@@ -63,6 +63,21 @@ unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
 #[derive(Debug, Copy, Clone)]
 pub struct TryFromSliceError(());
 
+impl fmt::Display for TryFromSliceError {
+    #[inline]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Display::fmt(self.__description())
+    }
+}
+
+impl TryFromSliceError {
+    #[inline]
+    #[doc(hidden)]
+    pub fn __description(&self) -> &str {
+        "could not convert slice to array"
+    }
+}
+
 macro_rules! __impl_slice_eq1 {
     ($Lhs: ty, $Rhs: ty) => {
         __impl_slice_eq1! { $Lhs, $Rhs, Sized }