From: Arthur Cohen Date: Wed, 22 Jan 2025 14:07:05 +0000 (+0000) Subject: ast: builder: Fix arguments of Builder::let X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28a87acaff74a87953d80df542b3d6e2e26daf62;p=thirdparty%2Fgcc.git 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 --git a/gcc/rust/ast/rust-ast-builder.cc b/gcc/rust/ast/rust-ast-builder.cc index 9685ae5aca9..e06b81c86d7 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 &&to_return) } std::unique_ptr -Builder::let (std::unique_ptr pattern, std::unique_ptr type, - std::unique_ptr init) const +Builder::let (std::unique_ptr &&pattern, std::unique_ptr &&type, + std::unique_ptr &&init) const { return std::unique_ptr (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 262bdcf18ff..6e4dfb8112f 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 : * = `) */ - std::unique_ptr let (std::unique_ptr pattern, - std::unique_ptr type = nullptr, - std::unique_ptr init = nullptr) const; + std::unique_ptr let (std::unique_ptr &&pattern, + std::unique_ptr &&type = nullptr, + std::unique_ptr &&init = nullptr) const; /** * Create a call expression to a function, struct or enum variant, given its