From: Arthur Cohen Date: Wed, 23 Apr 2025 10:37:57 +0000 (+0200) Subject: gccrs: derive(Ord): Fix condition for matching on Option::Some instead X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45730080b20102197cf5a4b621ebcd680185a602;p=thirdparty%2Fgcc.git 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 --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 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 ( new TupleStructItemsNoRange (vec (std::move (equal))));