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

gcc/rust/ChangeLog:

        * expand/rust-derive-ord.cc (DeriveOrd::cmp_call): Use references.
---
 gcc/rust/expand/rust-derive-ord.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/expand/rust-derive-ord.cc 
b/gcc/rust/expand/rust-derive-ord.cc
index ffe269c3c0a..1623495b8b6 100644
--- a/gcc/rust/expand/rust-derive-ord.cc
+++ b/gcc/rust/expand/rust-derive-ord.cc
@@ -46,7 +46,8 @@ DeriveOrd::cmp_call (std::unique_ptr<Expr> &&self_expr,
     {"core", "cmp", trait (ordering), fn (ordering)}, true);
 
   return builder.call (ptrify (cmp_fn_path),
-                      vec (std::move (self_expr), std::move (other_expr)));
+                      vec (builder.ref (std::move (self_expr)),
+                           builder.ref (std::move (other_expr))));
 }
 
 std::unique_ptr<Item>
-- 
2.49.0

Reply via email to