Rollup merge of #40566 - clarcharr:never_error, r=sfackler

Implement std::error::Error for !.
This commit is contained in:
Corey Farwell 2017-03-19 20:51:11 -04:00 committed by GitHub
commit 4e9033124b
2 changed files with 6 additions and 0 deletions

View File

@ -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" }

View File

@ -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)]