From: Arthur Cohen Date: Mon, 28 Apr 2025 09:35:53 +0000 (+0200) Subject: gccrs: derive(Ord): Fix cmp call to use references instead of values X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0194d12d27518d805d92f58f25ed5202fa835912;p=thirdparty%2Fgcc.git gccrs: derive(Ord): Fix cmp call to use references instead of values gcc/rust/ChangeLog: * expand/rust-derive-ord.cc (DeriveOrd::cmp_call): Use references. --- 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 &&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