1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use std::fmt;
use std::error;

/// An uninhabited type for use in statically impossible cases.
///
/// Will be replaced by Rust's `!` type once that stabilizes.
pub enum Void {}

impl fmt::Debug for Void {
    fn fmt( &self, _: &mut fmt::Formatter ) -> Result< (), fmt::Error > {
        unreachable!();
    }
}

impl fmt::Display for Void {
    fn fmt( &self, _: &mut fmt::Formatter ) -> Result< (), fmt::Error > {
        unreachable!();
    }
}

impl error::Error for Void {
    fn description( &self ) -> &str {
        unreachable!();
    }
}