Skip to content

Commit

Permalink
Rollup merge of rust-lang#40566 - clarcharr:never_error, r=sfackler
Browse files Browse the repository at this point in the history
Implement std::error::Error for !.
  • Loading branch information
frewsxcv authored Mar 20, 2017
2 parents dedf9d3 + a5cf551 commit 4e90331
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libstd/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
1 change: 1 addition & 0 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 4e90331

Please sign in to comment.