https://gcc.gnu.org/g:f6a2a71b3566e1063755124fcb513c39824c79eb

commit r15-8788-gf6a2a71b3566e1063755124fcb513c39824c79eb
Author: Arthur Cohen <arthur.co...@embecosm.com>
Date:   Wed Jan 22 14:07:05 2025 +0000

    gccrs: ast: builder: Fix arguments of Builder::let
    
    gcc/rust/ChangeLog:
    
            * ast/rust-ast-builder.h: Mark all arguments as &&.
            * ast/rust-ast-builder.cc (Builder::let): Likewise.

Diff:
---
 gcc/rust/ast/rust-ast-builder.cc | 4 ++--
 gcc/rust/ast/rust-ast-builder.h  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/rust/ast/rust-ast-builder.cc b/gcc/rust/ast/rust-ast-builder.cc
index 4c42b5bddae4..369f5a44630b 100644
--- a/gcc/rust/ast/rust-ast-builder.cc
+++ b/gcc/rust/ast/rust-ast-builder.cc
@@ -306,8 +306,8 @@ Builder::return_expr (std::unique_ptr<Expr> &&to_return)
 }
 
 std::unique_ptr<Stmt>
-Builder::let (std::unique_ptr<Pattern> pattern, std::unique_ptr<Type> type,
-             std::unique_ptr<Expr> init) const
+Builder::let (std::unique_ptr<Pattern> &&pattern, std::unique_ptr<Type> &&type,
+             std::unique_ptr<Expr> &&init) const
 {
   return std::unique_ptr<Stmt> (new LetStmt (std::move (pattern),
                                             std::move (init), std::move (type),
diff --git a/gcc/rust/ast/rust-ast-builder.h b/gcc/rust/ast/rust-ast-builder.h
index 21da13f14c89..99ab1610ce7a 100644
--- a/gcc/rust/ast/rust-ast-builder.h
+++ b/gcc/rust/ast/rust-ast-builder.h
@@ -95,9 +95,9 @@ public:
 
   /* Create a let binding with an optional type and initializer (`let <name> :
    * <type> = <init>`) */
-  std::unique_ptr<Stmt> let (std::unique_ptr<Pattern> pattern,
-                            std::unique_ptr<Type> type = nullptr,
-                            std::unique_ptr<Expr> init = nullptr) const;
+  std::unique_ptr<Stmt> let (std::unique_ptr<Pattern> &&pattern,
+                            std::unique_ptr<Type> &&type = nullptr,
+                            std::unique_ptr<Expr> &&init = nullptr) const;
 
   /**
    * Create a call expression to a function, struct or enum variant, given its

Reply via email to