Skip to content

Commit 1d9edfc

Browse files
committed
Retrieve token stream before vector move
gcc/rust/ChangeLog: * expand/rust-macro-builtins-helpers.cc: Remove use after move. Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
1 parent 36b8028 commit 1d9edfc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcc/rust/expand/rust-macro-builtins-helpers.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ make_eager_builtin_invocation (
6868
{
6969
auto path_str = make_macro_path_str (kind);
7070

71+
auto token_stream = arguments.to_token_stream ();
7172
std::unique_ptr<AST::Expr> node = AST::MacroInvocation::Builtin (
7273
kind,
7374
AST::MacroInvocData (AST::SimplePath (
@@ -76,7 +77,7 @@ make_eager_builtin_invocation (
7677
{}, locus, std::move (pending_invocations));
7778

7879
return AST::Fragment ({AST::SingleASTNode (std::move (node))},
79-
arguments.to_token_stream ());
80+
std::move (token_stream));
8081
}
8182

8283
/* Match the end token of a macro given the start delimiter of the macro */

0 commit comments

Comments
 (0)