diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-29 17:45:07 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-30 15:52:24 -0700 |
| commit | 748bc3ca49de8ab0b890726120c40567094e43fc (patch) | |
| tree | a205dcd5582cbecbb1a02fa3ed1ebfdcc85ff881 /src/libsyntax/ext/deriving/generic/mod.rs | |
| parent | f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341 (diff) | |
| download | rust-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/deriving/generic/mod.rs')
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/mod.rs | 20 |
1 files changed, 10 insertions, 10 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 } |
