]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 14 Apr 2025 08:03:49 +0000 (08:03 +0000)
gcc/rust/ChangeLog:

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

gcc/rust/rust-session-manager.cc

index cbdc8ba0f51fd01e0d487511a0d085ca01575c9d..5563d103ff5eb8c6ebf1bacb7b58318ad2c6cace 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))