Skip to content

Commit

Permalink
ast: builder: Fix arguments of Builder::let
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* ast/rust-ast-builder.h: Mark all arguments as &&.
	* ast/rust-ast-builder.cc (Builder::let): Likewise.
  • Loading branch information
CohenArthur committed Jan 29, 2025
1 parent 84bca6f commit 9f88012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gcc/rust/ast/rust-ast-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ Builder::block (std::vector<std::unique_ptr<Stmt>> &&stmts,
}

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),
Expand Down
6 changes: 3 additions & 3 deletions gcc/rust/ast/rust-ast-builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class Builder

/* 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
Expand Down

0 comments on commit 9f88012

Please sign in to comment.