https://gcc.gnu.org/g:688b8d8b0e24aa7e2a7f741355d696f60337f956
commit 688b8d8b0e24aa7e2a7f741355d696f60337f956 Author: Arthur Cohen <arthur.co...@embecosm.com> Date: Fri Apr 4 14:21:00 2025 +0200 session: Desugar question mark operator after expansion instead. gcc/rust/ChangeLog: * rust-session-manager.cc (Session::compile_crate): Call the visitor later in the pipeline. Diff: --- gcc/rust/rust-session-manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index cbdc8ba0f51f..5563d103ff5e 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -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))