Skip to content

Commit ac48343

Browse files
pkgwcatamorphism
authored andcommitted
---
yaml --- r: 38441 b: refs/heads/try c: d5dc66a h: refs/heads/master i: 38439: e60afb1 v: v3
1 parent 6ebb7e9 commit ac48343

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 7eae397e58641392c20b4baefb39257264f7dcde
5+
refs/heads/try: d5dc66ad3181ab4fa5fc3ccd806b25f3e5ddbe8f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/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)