]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Collect lang items after expansion
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 10 Jul 2025 22:57:12 +0000 (18:57 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 19:58:40 +0000 (20:58 +0100)
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 <powerboat9.gamer@gmail.com>
gcc/rust/rust-session-manager.cc

index 1a8b147ebca78588bfd49cc06bc807275fdbd1af..363feee18e97a71d3b48cb3ffd7b9863860315c6 100644 (file)
@@ -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))
     {