https://gcc.gnu.org/g:035990c57b58a1dc95ac2a36a17a15d1ae7255a2
commit 035990c57b58a1dc95ac2a36a17a15d1ae7255a2 Author: Arthur Cohen <arthur.co...@embecosm.com> Date: Thu Dec 26 21:31:21 2024 +0000 ast: Fix warning about copy elision for moved expr gcc/rust/ChangeLog: * ast/rust-ast.cc (BlockExpr::normalize_tail_expr): Remove overzealous std::move Diff: --- gcc/rust/ast/rust-ast.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc index d9197e3db059..ce4254ac8d07 100644 --- a/gcc/rust/ast/rust-ast.cc +++ b/gcc/rust/ast/rust-ast.cc @@ -4270,7 +4270,7 @@ BlockExpr::normalize_tail_expr () if (!stmt.is_semicolon_followed ()) { - expr = std::move (stmt.take_expr ()); + expr = stmt.take_expr (); statements.pop_back (); } }