From: Arthur Cohen <arthur.co...@embecosm.com>

gcc/rust/ChangeLog:

        * expand/rust-derive-ord.cc (DeriveOrd::make_cmp_arms): Fix condition.
---
 gcc/rust/expand/rust-derive-ord.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/expand/rust-derive-ord.cc 
b/gcc/rust/expand/rust-derive-ord.cc
index 68a9c53ab1c..ffe269c3c0a 100644
--- a/gcc/rust/expand/rust-derive-ord.cc
+++ b/gcc/rust/expand/rust-derive-ord.cc
@@ -117,8 +117,9 @@ DeriveOrd::make_cmp_arms ()
   std::unique_ptr<Pattern> equal = ptrify (
     builder.path_in_expression ({"core", "cmp", "Ordering", "Equal"}, true));
 
-  // We need to wrap the pattern in Option::Some if we are doing total ordering
-  if (ordering == Ordering::Total)
+  // We need to wrap the pattern in Option::Some if we are doing partial
+  // ordering
+  if (ordering == Ordering::Partial)
     {
       auto pattern_items = std::unique_ptr<TupleStructItems> (
        new TupleStructItemsNoRange (vec (std::move (equal))));
-- 
2.49.0

Reply via email to