https://gcc.gnu.org/g:884c8a41a70ccf10fc000904d3544582d1e9ef0e

commit r16-4794-g884c8a41a70ccf10fc000904d3544582d1e9ef0e
Author: Owen Avery <[email protected]>
Date:   Thu Jul 10 18:57:12 2025 -0400

    gccrs: Collect lang items after expansion
    
    This allows macros to create lang items.
    
    gcc/rust/ChangeLog:
    
            * rust-session-manager.cc (Session::compile_crate): Collect lang
            items after expansion.
    
    Signed-off-by: Owen Avery <[email protected]>

Diff:
---
 gcc/rust/rust-session-manager.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 1a8b147ebca7..363feee18e97 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -612,13 +612,13 @@ Session::compile_crate (const char *filename)
   if (last_step == CompileOptions::CompileStep::Expansion)
     return;
 
-  AST::CollectLangItems ().go (parsed_crate);
-
   auto name_resolution_ctx = Resolver2_0::NameResolutionContext ();
   // expansion pipeline stage
 
   expansion (parsed_crate, name_resolution_ctx);
 
+  AST::CollectLangItems ().go (parsed_crate);
+
   rust_debug ("\033[0;31mSUCCESSFULLY FINISHED EXPANSION \033[0m");
   if (options.dump_option_enabled (CompileOptions::EXPANSION_DUMP))
     {

Reply via email to