Skip to content

Commit a46503e

Browse files
pkgwcatamorphism
authored andcommitted
---
yaml --- r: 41719 b: refs/heads/master c: d5dc66a h: refs/heads/master i: 41717: 11d1899 41715: 8d072eb 41711: c8e6f47 v: v3
1 parent 3d400fd commit a46503e

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,5 +1,5 @@
11
---
2-
refs/heads/master: 7eae397e58641392c20b4baefb39257264f7dcde
2+
refs/heads/master: d5dc66ad3181ab4fa5fc3ccd806b25f3e5ddbe8f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/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)