https://gcc.gnu.org/g:73a77277d1aeaaaf422b6583e7dc75ac3013bc62

commit r16-2993-g73a77277d1aeaaaf422b6583e7dc75ac3013bc62
Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
Date:   Fri Aug 1 16:43:18 2025 +0200

    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 <pierre-emmanuel.pa...@embecosm.com>

Diff:
---
 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 864379a3ffa4..19af5df4a68c 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<AST::Expr> 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 */

Reply via email to