1 //! An uninhabitable type meaning it can never happen.
2 //!
3 //! To be replaced with `!` once it is stable.
4 
5 use std::error::Error;
6 use std::fmt;
7 
8 #[derive(Debug)]
9 pub(crate) enum Never {}
10 
11 impl fmt::Display for Never {
fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result12     fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
13         match *self {}
14     }
15 }
16 
17 impl Error for Never {
description(&self) -> &str18     fn description(&self) -> &str {
19         match *self {}
20     }
21 }
22