Skip to content

Commit 9562981

Browse files
committed
impl std::error::Error for convert::Infallible.
1 parent 5f6de3d commit 9562981

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libstd/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ use alloc::allocator;
5555
use any::TypeId;
5656
use cell;
5757
use char;
58+
use convert;
5859
use fmt::{self, Debug, Display};
5960
use mem::transmute;
6061
use num;
@@ -347,6 +348,12 @@ impl Error for char::ParseCharError {
347348
}
348349
}
349350

351+
#[unstable(feature = "try_from", issue = "33417")]
352+
impl Error for convert::Infallible {
353+
fn description(&self) -> &str {
354+
"an error of this type can never exist"
355+
}
356+
}
350357

351358
// copied from any.rs
352359
impl Error + 'static {

0 commit comments

Comments
 (0)