Skip to content

Commit 6da9610

Browse files
pkgwcatamorphism
authored andcommitted
---
yaml --- r: 34549 b: refs/heads/snap-stage3 c: d5dc66a h: refs/heads/master i: 34547: f5d64a4 v: v3
1 parent c919e6c commit 6da9610

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7eae397e58641392c20b4baefb39257264f7dcde
4+
refs/heads/snap-stage3: d5dc66ad3181ab4fa5fc3ccd806b25f3e5ddbe8f
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)