From 73a77277d1aeaaaf422b6583e7dc75ac3013bc62 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Fri, 1 Aug 2025 16:43:18 +0200 Subject: [PATCH] gccrs: 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 --- gcc/rust/expand/rust-macro-builtins-helpers.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/rust/expand/rust-macro-builtins-helpers.cc b/gcc/rust/expand/rust-macro-builtins-helpers.cc index 864379a3ffa..19af5df4a68 100644 --- a/gcc/rust/expand/rust-macro-builtins-helpers.cc +++ b/gcc/rust/expand/rust-macro-builtins-helpers.cc @@ -68,6 +68,7 @@ make_eager_builtin_invocation ( { auto path_str = make_macro_path_str (kind); + auto token_stream = arguments.to_token_stream (); std::unique_ptr node = AST::MacroInvocation::Builtin ( kind, AST::MacroInvocData (AST::SimplePath ( @@ -76,7 +77,7 @@ make_eager_builtin_invocation ( {}, locus, std::move (pending_invocations)); return AST::Fragment ({AST::SingleASTNode (std::move (node))}, - arguments.to_token_stream ()); + std::move (token_stream)); } /* Match the end token of a macro given the start delimiter of the macro */ -- 2.47.3