summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-29 17:45:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-05-30 15:52:24 -0700
commit748bc3ca49de8ab0b890726120c40567094e43fc (patch)
treea205dcd5582cbecbb1a02fa3ed1ebfdcc85ff881 /src/libsyntax/ext
parentf4fa7c8a07a96cc9d0aae0bfc6515fb747f25341 (diff)
downloadrust-748bc3ca49de8ab0b890726120c40567094e43fc.tar.gz
rust-748bc3ca49de8ab0b890726120c40567094e43fc.zip
std: Rename {Eq,Ord} to Partial{Eq,Ord}
This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.

cc #12517

[breaking-change]
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/deriving/generic/mod.rs20
-rw-r--r--src/libsyntax/ext/deriving/mod.rs5
-rw-r--r--src/libsyntax/ext/format.rs2
-rw-r--r--src/libsyntax/ext/mtwt.rs4
4 files changed, 15 insertions, 16 deletions
diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs
index 0f4af144ead..e2290129dc8 100644
--- a/src/libsyntax/ext/deriving/generic/mod.rs
+++ b/src/libsyntax/ext/deriving/generic/mod.rs
@@ -24,7 +24,7 @@ Supported features (fairly exhaustive):
   current trait as a bound. (This includes separate type parameters
   and lifetimes for methods.)
 - Additional bounds on the type parameters, e.g. the `Ord` instance
-  requires an explicit `Eq` bound at the
+  requires an explicit `PartialEq` bound at the
   moment. (`TraitDef.additional_bounds`)
 
 Unsupported: FIXME #6257: calling methods on reference fields,
@@ -82,13 +82,13 @@ variants, it is represented as a count of 0.
 
 # Examples
 
-The following simplified `Eq` is used for in-code examples:
+The following simplified `PartialEq` is used for in-code examples:
 
 ```rust
-trait Eq {
+trait PartialEq {
     fn eq(&self, other: &Self);
 }
-impl Eq for int {
+impl PartialEq for int {
     fn eq(&self, other: &int) -> bool {
         *self == *other
     }
@@ -96,7 +96,7 @@ impl Eq for int {
 ```
 
 Some examples of the values of `SubstructureFields` follow, using the
-above `Eq`, `A`, `B` and `C`.
+above `PartialEq`, `A`, `B` and `C`.
 
 ## Structs
 
@@ -645,11 +645,11 @@ impl<'a> MethodDef<'a> {
 
     /**
    ~~~
-    #[deriving(Eq)]
+    #[deriving(PartialEq)]
     struct A { x: int, y: int }
 
     // equivalent to:
-    impl Eq for A {
+    impl PartialEq for A {
         fn eq(&self, __arg_1: &A) -> bool {
             match *self {
                 A {x: ref __self_0_0, y: ref __self_0_1} => {
@@ -750,7 +750,7 @@ impl<'a> MethodDef<'a> {
 
     /**
    ~~~
-    #[deriving(Eq)]
+    #[deriving(PartialEq)]
     enum A {
         A1
         A2(int)
@@ -758,7 +758,7 @@ impl<'a> MethodDef<'a> {
 
     // is equivalent to (with const_nonmatching == false)
 
-    impl Eq for A {
+    impl PartialEq for A {
         fn eq(&self, __arg_1: &A) {
             match *self {
                 A1 => match *__arg_1 {
@@ -994,7 +994,7 @@ impl<'a> MethodDef<'a> {
     }
 }
 
-#[deriving(Eq)] // dogfooding!
+#[deriving(PartialEq)] // dogfooding!
 enum StructType {
     Unknown, Record, Tuple
 }
diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs
index e5da7330a6c..3735248e9e2 100644
--- a/src/libsyntax/ext/deriving/mod.rs
+++ b/src/libsyntax/ext/deriving/mod.rs
@@ -77,10 +77,9 @@ pub fn expand_meta_deriving(cx: &mut ExtCtxt,
                             "Encodable" => expand!(encodable::expand_deriving_encodable),
                             "Decodable" => expand!(decodable::expand_deriving_decodable),
 
-                            // NOTE this needs treatment after a stage0 snap
-                            "PartialEq" | "Eq" => expand!(eq::expand_deriving_eq),
+                            "PartialEq" => expand!(eq::expand_deriving_eq),
                             "TotalEq" => expand!(totaleq::expand_deriving_totaleq),
-                            "PartialOrd" | "Ord" => expand!(ord::expand_deriving_ord),
+                            "PartialOrd" => expand!(ord::expand_deriving_ord),
                             "TotalOrd" => expand!(totalord::expand_deriving_totalord),
 
                             "Rand" => expand!(rand::expand_deriving_rand),
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index c05fc8ce6d9..0d228a1146d 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -21,7 +21,7 @@ use rsparse = parse;
 use parse = fmt_macros;
 use collections::{HashMap, HashSet};
 
-#[deriving(Eq)]
+#[deriving(PartialEq)]
 enum ArgumentType {
     Known(String),
     Unsigned,
diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs
index fdaa3b5630a..12e314781ae 100644
--- a/src/libsyntax/ext/mtwt.rs
+++ b/src/libsyntax/ext/mtwt.rs
@@ -37,7 +37,7 @@ pub struct SCTable {
     rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>,
 }
 
-#[deriving(Eq, Encodable, Decodable, Hash)]
+#[deriving(PartialEq, Encodable, Decodable, Hash)]
 pub enum SyntaxContext_ {
     EmptyCtxt,
     Mark (Mrk,SyntaxContext),
@@ -294,7 +294,7 @@ mod tests {
 
     // because of the SCTable, I now need a tidy way of
     // creating syntax objects. Sigh.
-    #[deriving(Clone, Eq, Show)]
+    #[deriving(Clone, PartialEq, Show)]
     enum TestSC {
         M(Mrk),
         R(Ident,Name)