Skip to content

Commit

Permalink
impl From<Infallible> for TryFromSliceError
Browse files Browse the repository at this point in the history
  • Loading branch information
Jethro Beekman committed Apr 29, 2019
1 parent 597f432 commit 24d89e5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libcore/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 24d89e5

Please sign in to comment.