]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: session: Desugar question mark operator after expansion instead.
authorArthur Cohen <arthur.cohen@embecosm.com>
Fri, 4 Apr 2025 12:21:00 +0000 (14:21 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 14 Apr 2025 16:23:54 +0000 (18:23 +0200)
gcc/rust/ChangeLog:

* rust-session-manager.cc (Session::compile_crate): Call the visitor later in the pipeline.

gcc/rust/rust-session-manager.cc

index 15f21ef12a963fc0199e13cf5832b9c65067ffd6..48acbf34222277c5b7d835833afe45335d992b5f 100644 (file)
@@ -611,7 +611,6 @@ Session::compile_crate (const char *filename)
     return;
 
   AST::CollectLangItems ().go (parsed_crate);
-  AST::DesugarQuestionMark ().go (parsed_crate);
 
   auto name_resolution_ctx = Resolver2_0::NameResolutionContext ();
   // expansion pipeline stage
@@ -619,6 +618,7 @@ Session::compile_crate (const char *filename)
   expansion (parsed_crate, name_resolution_ctx);
 
   AST::DesugarForLoops ().go (parsed_crate);
+  AST::DesugarQuestionMark ().go (parsed_crate);
 
   rust_debug ("\033[0;31mSUCCESSFULLY FINISHED EXPANSION \033[0m");
   if (options.dump_option_enabled (CompileOptions::EXPANSION_DUMP))