Skip to content

Commit 126bcd9

Browse files
CohenArthurphilberty
authored andcommitted
derive(Ord): Fix condition for matching on Option::Some instead
gcc/rust/ChangeLog: * expand/rust-derive-ord.cc (DeriveOrd::make_cmp_arms): Fix condition.
1 parent fcb6b88 commit 126bcd9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gcc/rust/expand/rust-derive-ord.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ DeriveOrd::make_cmp_arms ()
117117
std::unique_ptr<Pattern> equal = ptrify (
118118
builder.path_in_expression ({"core", "cmp", "Ordering", "Equal"}, true));
119119

120-
// We need to wrap the pattern in Option::Some if we are doing total ordering
121-
if (ordering == Ordering::Total)
120+
// We need to wrap the pattern in Option::Some if we are doing partial
121+
// ordering
122+
if (ordering == Ordering::Partial)
122123
{
123124
auto pattern_items = std::unique_ptr<TupleStructItems> (
124125
new TupleStructItemsNoRange (vec (std::move (equal))));

0 commit comments

Comments
 (0)