about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-03-19 20:51:11 -0400
committerGitHub <noreply@github.com>2017-03-19 20:51:11 -0400
commit4e9033124b781f0d54de50fe47bb4cc2331940e5 (patch)
tree301b5987570ae0d3c7533ffa61c13614b4d05648 /src/libstd
parentdedf9d3593632faea7ccb2f78bd6517ce56bb06d (diff)
parenta5cf55125c9e5d36547a31f2ff0f028cc51b4855 (diff)
downloadrust-4e9033124b781f0d54de50fe47bb4cc2331940e5.tar.gz
rust-4e9033124b781f0d54de50fe47bb4cc2331940e5.zip
Rollup merge of #40566 - clarcharr:never_error, r=sfackler
Implement std::error::Error for !.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/error.rs5
-rw-r--r--src/libstd/lib.rs1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index e115263d2eb..3d80120f6b2 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -216,6 +216,11 @@ impl<'a> From<&'a str> for Box<Error> {
     }
 }
 
+#[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 206a37b8e5d..d01ed1e3fe6 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -272,6 +272,7 @@
 #![feature(linkage)]
 #![feature(macro_reexport)]
 #![feature(needs_panic_runtime)]
+#![feature(never_type)]
 #![feature(num_bits_bytes)]
 #![feature(old_wrapping)]
 #![feature(on_unimplemented)]