Skip to content

Commit 9055c32

Browse files
CohenArthurphilberty
authored andcommitted
derive(Ord): Fix cmp call to use references instead of values
gcc/rust/ChangeLog: * expand/rust-derive-ord.cc (DeriveOrd::cmp_call): Use references.
1 parent 126bcd9 commit 9055c32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ DeriveOrd::cmp_call (std::unique_ptr<Expr> &&self_expr,
4646
{"core", "cmp", trait (ordering), fn (ordering)}, true);
4747

4848
return builder.call (ptrify (cmp_fn_path),
49-
vec (std::move (self_expr), std::move (other_expr)));
49+
vec (builder.ref (std::move (self_expr)),
50+
builder.ref (std::move (other_expr))));
5051
}
5152

5253
std::unique_ptr<Item>

0 commit comments

Comments
 (0)