diff --git a/src/lib.rs b/src/lib.rs index 40eb941..2545776 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,7 +59,7 @@ //! ``` //! #![deny(missing_docs)] -#![feature(plugin, conservative_impl_trait, never_type, proc_macro, unboxed_closures, fn_traits, specialization)] +#![feature(plugin, conservative_impl_trait, never_type, unboxed_closures, fn_traits, specialization)] #![plugin(tarpc_plugins)] extern crate byteorder; diff --git a/src/util.rs b/src/util.rs index 6fd9f2e..e55c8f6 100644 --- a/src/util.rs +++ b/src/util.rs @@ -15,14 +15,17 @@ use tokio_core::reactor; /// A bottom type that impls `Error`, `Serialize`, and `Deserialize`. It is impossible to /// instantiate this type. #[allow(unreachable_code)] -#[derive(Debug)] pub struct Never(!); +impl fmt::Debug for Never { + fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { + unreachable!("Never cannot be instantiated"); + } +} + impl Error for Never { fn description(&self) -> &str { match self.0 { - // TODO(tikue): remove when https://github.com/rust-lang/rust/issues/12609 lands - _ => unreachable!(), } } } @@ -30,8 +33,6 @@ impl Error for Never { impl fmt::Display for Never { fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { match self.0 { - // TODO(tikue): remove when https://github.com/rust-lang/rust/issues/12609 lands - _ => unreachable!(), } } } @@ -42,8 +43,6 @@ impl Future for Never { fn poll(&mut self) -> Poll { match self.0 { - // TODO(tikue): remove when https://github.com/rust-lang/rust/issues/12609 lands - _ => unreachable!(), } } } @@ -54,8 +53,6 @@ impl Stream for Never { fn poll(&mut self) -> Poll, Self::Error> { match self.0 { - // TODO(tikue): remove when https://github.com/rust-lang/rust/issues/12609 lands - _ => unreachable!(), } } } @@ -65,8 +62,6 @@ impl Serialize for Never { where S: Serializer { match self.0 { - // TODO(tikue): remove when https://github.com/rust-lang/rust/issues/12609 lands - _ => unreachable!(), } } }