about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/graph.rs
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2021-01-25 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2021-02-09 08:15:37 +0100
commite4efccd4a6eef45e9648452360accab48b28f674 (patch)
tree6ea614450c1e1fff32e46b9ad9e37f2b09117f5a /compiler/rustc_mir/src/transform/coverage/graph.rs
parent921ec4b3fca17cc777766c240038d7d50ba98e0d (diff)
downloadrust-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 'compiler/rustc_mir/src/transform/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions