]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: builder: Fix arguments of Builder::let
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 22 Jan 2025 14:07:05 +0000 (14:07 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Mar 2025 12:07:03 +0000 (13:07 +0100)
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 4c42b5bddae423f3fc32c9b0ae65df7434b4169e..369f5a44630b174941e72e9ade01cbe7cee78d89 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 21da13f14c89cd10eaafcc95c73116fc1187c484..99ab1610ce7a0c140ced82b9bf9ba40aee82cda9 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