implement std::cmp::* traits for !
This commit is contained in:
parent
b22beed737
commit
51c6ae25e2
@ -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<Ordering> {
|
||||
*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")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user