Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize cmp #20065

Merged
merged 1 commit into from
Dec 31, 2014
Merged

Stabilize cmp #20065

merged 1 commit into from
Dec 31, 2014

Conversation

aturon
Copy link
Member

@aturon aturon commented Dec 20, 2014

This patch marks PartialEq, Eq, PartialOrd, and Ord as
#[stable], as well as the majorify of manual implementaitons of these
traits. The traits match the reform RFC.

In the future, many of the impls should be generalized; see #20063.
However, there is no problem stabilizing the less general impls, since
generalizing later is not a breaking change.

r? @alexcrichton

@alexcrichton
Copy link
Member

I believe @aturon is on vacation for the coming week, but I'd like to discuss this in more detail with him, so I'm holding off on the r+ for now.

@@ -79,7 +81,7 @@ pub trait PartialEq<Sized? Rhs = Self> for Sized? {
/// - reflexive: `a == a`;
/// - symmetric: `a == b` implies `b == a`; and
/// - transitive: `a == b` and `b == c` implies `a == c`.
#[unstable = "Definition may change slightly after trait reform"]
#[stable]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need to remove assert_receiver_is_total_eq before marking this stable (but it's close!)

@aturon
Copy link
Member Author

aturon commented Dec 30, 2014

@alexcrichton I believe all your comments have now been addressed.

@@ -1 +1 @@
Subproject commit 3a37981744a5af2433fed551f742465c78c9af7f
Subproject commit aed73472416064642911af790b25d57c9390b6c7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was reverted by accident

@alexcrichton
Copy link
Member

r=me with a minor nit plus a [breaking-change] tag

This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as
`#[stable]`, as well as the majorify of manual implementaitons of these
traits. The traits match the [reform
RFC](rust-lang/rfcs#439).

Along the way, two changes are made:

* The recently-added type parameters for `Ord` and `Eq` are
  removed. These were mistakenly added while adding them to `PartialOrd`
  and `PartialEq`, but they don't make sense given the laws that are
  required for (and use cases for) `Ord` and `Eq`.

* More explicit laws are added for `PartialEq` and `PartialOrd`,
  connecting them to their associated mathematical concepts.

In the future, many of the impls should be generalized; see
since generalizing later is not a breaking change.

[breaking-change]
#[unstable = "Definition may change slightly after trait reform"]
pub trait Eq<Sized? Rhs = Self> for Sized?: PartialEq<Rhs> {
#[stable]
pub trait Eq for Sized?: PartialEq<Self> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're stabilizing this with assert_receiver_is_total_eq?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under the assumption that we can remove it before 1.0 final.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 31, 2014
This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as
`#[stable]`, as well as the majorify of manual implementaitons of these
traits. The traits match the [reform RFC](rust-lang/rfcs#439).

In the future, many of the impls should be generalized; see rust-lang#20063.
However, there is no problem stabilizing the less general impls, since
generalizing later is not a breaking change.

r? @alexcrichton
@bors bors merged commit b94bcbf into rust-lang:master Dec 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants