Skip to content

Commit 24d89e5

Browse files
author
Jethro Beekman
committed
impl From<Infallible> for TryFromSliceError
1 parent 597f432 commit 24d89e5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libcore/array.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use crate::borrow::{Borrow, BorrowMut};
1313
use crate::cmp::Ordering;
14-
use crate::convert::TryFrom;
14+
use crate::convert::{Infallible, TryFrom};
1515
use crate::fmt;
1616
use crate::hash::{Hash, self};
1717
use crate::marker::Unsize;
@@ -72,6 +72,13 @@ impl TryFromSliceError {
7272
}
7373
}
7474

75+
#[stable(feature = "try_from_slice_error", since = "1.36.0")]
76+
impl From<Infallible> for TryFromSliceError {
77+
fn from(x: Infallible) -> TryFromSliceError {
78+
match x {}
79+
}
80+
}
81+
7582
macro_rules! __impl_slice_eq1 {
7683
($Lhs: ty, $Rhs: ty) => {
7784
__impl_slice_eq1! { $Lhs, $Rhs, Sized }

0 commit comments

Comments
 (0)