Skip to content

Commit

Permalink
Implement Error for !.
Browse files Browse the repository at this point in the history
  • Loading branch information
clarfonthey committed Mar 16, 2017
1 parent 11a3376 commit a5cf551
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 @@ -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)]
Expand Down

0 comments on commit a5cf551

Please sign in to comment.