Implement RFC#28: Add PartialOrd::partial_cmp
I ended up altering the semantics of Json's PartialOrd implementation. It used to be the case that Null < Null, but I can't think of any reason for an ordering other than the default one so I just switched it over to using the derived implementation. This also fixes broken `PartialOrd` implementations for `Vec` and `TreeMap`. RFC: 0028-partial-cmp
This commit is contained in:
parent
bb5695b95c
commit
55cae0a094
28 changed files with 343 additions and 161 deletions
|
|
@ -27,6 +27,7 @@ enum Enum {
|
|||
//~^^^^^ ERROR
|
||||
//~^^^^^^ ERROR
|
||||
//~^^^^^^^ ERROR
|
||||
//~^^^^^^^^ ERROR
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ enum Enum {
|
|||
//~^^^^^ ERROR
|
||||
//~^^^^^^ ERROR
|
||||
//~^^^^^^^ ERROR
|
||||
//~^^^^^^^^ ERROR
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ struct Struct {
|
|||
//~^^^^^ ERROR
|
||||
//~^^^^^^ ERROR
|
||||
//~^^^^^^^ ERROR
|
||||
//~^^^^^^^^ ERROR
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ struct Struct(
|
|||
//~^^^^^ ERROR
|
||||
//~^^^^^^ ERROR
|
||||
//~^^^^^^^ ERROR
|
||||
//~^^^^^^^^ ERROR
|
||||
);
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#[deriving(PartialEq)]
|
||||
struct thing(uint);
|
||||
impl PartialOrd for thing { //~ ERROR not all trait methods implemented, missing: `lt`
|
||||
impl PartialOrd for thing { //~ ERROR not all trait methods implemented, missing: `partial_cmp`
|
||||
fn le(&self, other: &thing) -> bool { true }
|
||||
fn ge(&self, other: &thing) -> bool { true }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue