Auto merge of #60318 - jethrogb:jb/try-from-slice-to-infallible, r=sfackler
impl From<Infallible> for TryFromSliceError I believe this was missed when TryFrom was stabilized. I think `TryFromSliceError` and `TryFromIntError` are the only two `TryFrom` error types that appear in `std`. I think trait implementations have to be insta-stable, but I'm not sure.
This commit is contained in:
@@ -8,7 +8,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;
|
||||
@@ -74,6 +74,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 }
|
||||
|
||||
Reference in New Issue
Block a user