about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-02-24 08:11:00 -0500
committerDaniel Micay <danielmicay@gmail.com>2014-03-07 22:45:22 -0500
commit4d7d101a76deea69e9078d9ed6bb93ecca70e52a (patch)
tree3365108e59d5c6d4ee0655347ce3ed447cc7d016 /src/libsyntax
parent33768c46ec980a911284d77804e5e45ead6530eb (diff)
downloadrust-4d7d101a76deea69e9078d9ed6bb93ecca70e52a.tar.gz
rust-4d7d101a76deea69e9078d9ed6bb93ecca70e52a.zip
create a sensible comparison trait hierarchy
* `Ord` inherits from `Eq`
* `TotalOrd` inherits from `TotalEq`
* `TotalOrd` inherits from `Ord`
* `TotalEq` inherits from `Eq`

This is a partial implementation of #12517.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index a8480b6cfeb..0a959993517 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -39,7 +39,7 @@ pub fn P<T: 'static>(value: T) -> P<T> {
 // table) and a SyntaxContext to track renaming and
 // macro expansion per Flatt et al., "Macros
 // That Work Together"
-#[deriving(Clone, Hash, TotalEq, TotalOrd, Show)]
+#[deriving(Clone, Hash, Ord, TotalEq, TotalOrd, Show)]
 pub struct Ident {
     name: Name,
     ctxt: SyntaxContext
@@ -151,7 +151,7 @@ pub type CrateNum = u32;
 
 pub type NodeId = u32;
 
-#[deriving(Clone, TotalEq, TotalOrd, Eq, Encodable, Decodable, Hash, Show)]
+#[deriving(Clone, TotalEq, TotalOrd, Ord, Eq, Encodable, Decodable, Hash, Show)]
 pub struct DefId {
     krate: CrateNum,
     node: NodeId,