Skip to content

Commit 4e1caab

Browse files
pkgwcatamorphism
authored andcommitted
---
yaml --- r: 39826 b: refs/heads/incoming c: d5dc66a h: refs/heads/master v: v3
1 parent 5b53780 commit 4e1caab

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: 7eae397e58641392c20b4baefb39257264f7dcde
9+
refs/heads/incoming: d5dc66ad3181ab4fa5fc3ccd806b25f3e5ddbe8f
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/cmp.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ and `Eq` to overload the `==` and `!=` operators.
3030
*
3131
* Eventually this may be simplified to only require
3232
* an `eq` method, with the other generated from
33-
* a default implementation.
33+
* a default implementation. However it should
34+
* remain possible to implement `ne` separately, for
35+
* compatibility with floating-point NaN semantics
36+
* (cf. IEEE 754-2008 section 5.11).
3437
*/
3538
#[lang="eq"]
3639
pub trait Eq {
@@ -43,7 +46,10 @@ pub trait Eq {
4346
*
4447
* Eventually this may be simplified to only require
4548
* an `le` method, with the others generated from
46-
* default implementations.
49+
* default implementations. However it should remain
50+
* possible to implement the others separately, for
51+
* compatibility with floating-point NaN semantics
52+
* (cf. IEEE 754-2008 section 5.11).
4753
*/
4854
#[lang="ord"]
4955
pub trait Ord {
@@ -59,8 +65,8 @@ pub pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool {
5965
}
6066

6167
#[inline(always)]
62-
pub pure fn le<T: Ord Eq>(v1: &T, v2: &T) -> bool {
63-
(*v1).lt(v2) || (*v1).eq(v2)
68+
pub pure fn le<T: Ord>(v1: &T, v2: &T) -> bool {
69+
(*v1).le(v2)
6470
}
6571

6672
#[inline(always)]

0 commit comments

Comments
 (0)