]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ast: Fix warning about copy elision for moved expr
authorArthur Cohen <arthur.cohen@embecosm.com>
Thu, 26 Dec 2024 21:31:21 +0000 (21:31 +0000)
committerCohenArthur <arthur.cohen@embecosm.com>
Thu, 16 Jan 2025 14:00:31 +0000 (14:00 +0000)
gcc/rust/ChangeLog:

* ast/rust-ast.cc (BlockExpr::normalize_tail_expr): Remove overzealous
std::move

gcc/rust/ast/rust-ast.cc

index d9197e3db059716be65c76a4a36298b453830547..ce4254ac8d07a7dcb1ea117dd3aa2c44bed8f35e 100644 (file)
@@ -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 ();
            }
        }