https://gcc.gnu.org/g:45730080b20102197cf5a4b621ebcd680185a602

commit r16-2867-g45730080b20102197cf5a4b621ebcd680185a602
Author: Arthur Cohen <arthur.co...@embecosm.com>
Date:   Wed Apr 23 12:37:57 2025 +0200

    gccrs: derive(Ord): Fix condition for matching on Option::Some instead
    
    gcc/rust/ChangeLog:
    
            * expand/rust-derive-ord.cc (DeriveOrd::make_cmp_arms): Fix 
condition.

Diff:
---
 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 68a9c53ab1c9..ffe269c3c0a4 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))));

Reply via email to