From a5cf55125c9e5d36547a31f2ff0f028cc51b4855 Mon Sep 17 00:00:00 2001 From: Clar Charr Date: Wed, 15 Mar 2017 23:07:28 -0400 Subject: [PATCH] Implement Error for !. --- src/libstd/error.rs | 5 +++++ src/libstd/lib.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/libstd/error.rs b/src/libstd/error.rs index e115263d2eb95..3d80120f6b2bd 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -216,6 +216,11 @@ impl<'a> From<&'a str> for Box { } } +#[stable(feature = "never_error", since = "1.18.0")] +impl Error for ! { + fn description(&self) -> &str { *self } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Error for str::ParseBoolError { fn description(&self) -> &str { "failed to parse bool" } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 7fa5ad255609c..c8437fefe84b1 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -273,6 +273,7 @@ #![feature(linkage)] #![feature(macro_reexport)] #![feature(needs_panic_runtime)] +#![feature(never_type)] #![feature(num_bits_bytes)] #![feature(old_wrapping)] #![feature(on_unimplemented)]