diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 8764766b2ef8..1d2ed735e813 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -699,6 +699,39 @@ mod impls { ord_impl! { char usize u8 u16 u32 u64 isize i8 i16 i32 i64 } + // Note: This macro is a temporary hack that can be remove once we are building with a compiler + // that supports `!` + macro_rules! argh { + () => { + #[unstable(feature = "bang_type", issue = "35121")] + impl PartialEq for ! { + fn eq(&self, _: &!) -> bool { + *self + } + } + + #[unstable(feature = "bang_type", issue = "35121")] + impl Eq for ! {} + + #[unstable(feature = "bang_type", issue = "35121")] + impl PartialOrd for ! { + fn partial_cmp(&self, _: &!) -> Option { + *self + } + } + + #[unstable(feature = "bang_type", issue = "35121")] + impl Ord for ! { + fn cmp(&self, _: &!) -> Ordering { + *self + } + } + } + } + + #[cfg(not(stage0))] + argh!(); + // & pointers #[stable(feature = "rust1", since = "1.0.0")]