[COMMITTED 121/146] gccrs: ast: Fix warning about copy elision for moved expr

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Fri Mar 21 12:07:02 GMT 2025


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

gcc/rust/ChangeLog:

	* ast/rust-ast.cc (BlockExpr::normalize_tail_expr): Remove overzealous
	std::move
---
 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 25e522bf948..45189a1a4b3 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 ();
 	    }
 	}
-- 
2.45.2



More information about the Gcc-rust mailing list