https://gcc.gnu.org/g:28a87acaff74a87953d80df542b3d6e2e26daf62
commit 28a87acaff74a87953d80df542b3d6e2e26daf62 Author: Arthur Cohen <arthur.co...@embecosm.com> Date: Wed Jan 22 14:07:05 2025 +0000 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 9685ae5aca9d..e06b81c86d7f 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 262bdcf18ff7..6e4dfb8112f1 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