diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-01-25 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-02-09 08:15:37 +0100 |
| commit | e4efccd4a6eef45e9648452360accab48b28f674 (patch) | |
| tree | 6ea614450c1e1fff32e46b9ad9e37f2b09117f5a /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 921ec4b3fca17cc777766c240038d7d50ba98e0d (diff) | |
| download | rust-e4efccd4a6eef45e9648452360accab48b28f674.tar.gz rust-e4efccd4a6eef45e9648452360accab48b28f674.zip | |
Fix derived PartialOrd operators
The derived implementation of `partial_cmp` compares matching fields one by one, stopping the computation when the result of a comparison is not equal to `Some(Equal)`. On the other hand the derived implementation for `lt`, `le`, `gt` and `ge` continues the computation when the result of a field comparison is `None`, consequently those operators are not transitive and inconsistent with `partial_cmp`. Fix the inconsistency by using the default implementation that fall-backs to the `partial_cmp`. This also avoids creating very deeply nested closures that were quite costly to compile.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
