]> git.lizzy.rs Git - rust.git/commit
Stabilize cmp
authorAaron Turon <aturon@mozilla.com>
Tue, 30 Dec 2014 22:44:26 +0000 (14:44 -0800)
committerAaron Turon <aturon@mozilla.com>
Tue, 30 Dec 2014 22:44:26 +0000 (14:44 -0800)
commitb94bcbf56eab163517e8ffc93888284b8dbb6238
tree7a18c863cc94c86dd6ba2d9813af0d0af2b5b512
parent84f5ad8679c7fc454473ffbf389030f3e5fee379
Stabilize cmp

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](https://github.com/rust-lang/rfcs/pull/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]
20 files changed:
src/liballoc/arc.rs
src/liballoc/boxed.rs
src/liballoc/rc.rs
src/libcollections/bit.rs
src/libcollections/btree/map.rs
src/libcollections/dlist.rs
src/libcollections/ring_buf.rs
src/libcollections/string.rs
src/libcollections/vec.rs
src/libcollections/vec_map.rs
src/libcore/array.rs
src/libcore/borrow.rs
src/libcore/cell.rs
src/libcore/cmp.rs
src/libcore/ptr.rs
src/libcore/slice.rs
src/libcore/str/mod.rs
src/libcore/tuple.rs
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/set.rs