File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,21 @@ unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
6363#[ derive( Debug , Copy , Clone ) ]
6464pub struct TryFromSliceError ( ( ) ) ;
6565
66+ impl fmt:: Display for TryFromSliceError {
67+ #[ inline]
68+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
69+ fmt:: Display :: fmt ( self . __description ( ) )
70+ }
71+ }
72+
73+ impl TryFromSliceError {
74+ #[ inline]
75+ #[ doc( hidden) ]
76+ pub fn __description ( & self ) -> & str {
77+ "could not convert slice to array"
78+ }
79+ }
80+
6681macro_rules! __impl_slice_eq1 {
6782 ( $Lhs: ty, $Rhs: ty) => {
6883 __impl_slice_eq1! { $Lhs, $Rhs, Sized }
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ use any::TypeId;
5656use borrow:: Cow ;
5757use cell;
5858use char;
59+ use core:: array;
5960use fmt:: { self , Debug , Display } ;
6061use mem:: transmute;
6162use num;
@@ -281,6 +282,13 @@ impl Error for num::TryFromIntError {
281282 }
282283}
283284
285+ #[ unstable( feature = "try_from" , issue = "33417" ) ]
286+ impl Error for array:: TryFromSliceError {
287+ fn description ( & self ) -> & str {
288+ self . __description ( )
289+ }
290+ }
291+
284292#[ stable( feature = "rust1" , since = "1.0.0" ) ]
285293impl Error for num:: ParseFloatError {
286294 fn description ( & self ) -> & str {
You can’t perform that action at this time.
0 commit comments