https://gcc.gnu.org/g:76477f965552b5872bb14255f272bff78978ef0c
commit r15-9443-g76477f965552b5872bb14255f272bff78978ef0c Author: Arthur Cohen <arthur.co...@embecosm.com> Date: Fri Apr 4 14:21:00 2025 +0200 gccrs: 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 15f21ef12a96..48acbf342222 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))