Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix derived PartialOrd operators #81384

Merged
merged 2 commits into from
Feb 9, 2021
Merged

Fix derived PartialOrd operators #81384

merged 2 commits into from
Feb 9, 2021

Commits on Feb 9, 2021

  1. 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.
    tmiasko committed Feb 9, 2021
    Configuration menu
    Copy the full SHA
    e4efccd View commit details
    Browse the repository at this point in the history
  2. ./x.py test --bless

    tmiasko committed Feb 9, 2021
    Configuration menu
    Copy the full SHA
    62366ee View commit details
    Browse the repository at this point in the history