]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ast: builder: Fix arguments of Builder::let
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 22 Jan 2025 14:07:05 +0000 (14:07 +0000)
committerCohenArthur <arthur.cohen@embecosm.com>
Tue, 4 Feb 2025 15:09:51 +0000 (15:09 +0000)
gcc/rust/ChangeLog:

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

gcc/rust/ast/rust-ast-builder.cc
gcc/rust/ast/rust-ast-builder.h

index 9685ae5aca9d7f0731151eb2ff3710f2712e4550..e06b81c86d7f43e6af3e26fcecf40c7ae4c59127 100644 (file)
@@ -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),
index 262bdcf18ff77018b4a26e1ce9fada5fc608586c..6e4dfb8112f108d9f9f259102f19c56362c6ee67 100644 (file)
@@ -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