Skip to content

Commit 28a87ac

Browse files
committed
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.
1 parent ca227ed commit 28a87ac

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ Builder::return_expr (std::unique_ptr<Expr> &&to_return)
306306
}
307307

308308
std::unique_ptr<Stmt>
309-
Builder::let (std::unique_ptr<Pattern> pattern, std::unique_ptr<Type> type,
310-
std::unique_ptr<Expr> init) const
309+
Builder::let (std::unique_ptr<Pattern> &&pattern, std::unique_ptr<Type> &&type,
310+
std::unique_ptr<Expr> &&init) const
311311
{
312312
return std::unique_ptr<Stmt> (new LetStmt (std::move (pattern),
313313
std::move (init), std::move (type),

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ class Builder
9595

9696
/* Create a let binding with an optional type and initializer (`let <name> :
9797
* <type> = <init>`) */
98-
std::unique_ptr<Stmt> let (std::unique_ptr<Pattern> pattern,
99-
std::unique_ptr<Type> type = nullptr,
100-
std::unique_ptr<Expr> init = nullptr) const;
98+
std::unique_ptr<Stmt> let (std::unique_ptr<Pattern> &&pattern,
99+
std::unique_ptr<Type> &&type = nullptr,
100+
std::unique_ptr<Expr> &&init = nullptr) const;
101101

102102
/**
103103
* Create a call expression to a function, struct or enum variant, given its

0 commit comments

Comments
 (0)