From 1490b80bd143b8808678e9449b070d5f18ac588c Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Fri, 18 Jul 2025 16:44:36 +0100 Subject: [PATCH] gccrs: return error node when this fails during constexpr case Not adding the test case here we emit more errors than rustc for the error type node so its just noisy and dejagnu is being a pain. Fixes Rust-GCC#3933 gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): return error_mark_node Signed-off-by: Philip Herron --- gcc/rust/backend/rust-compile-resolve-path.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index a80484acf09..6d92c0cd102 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -214,7 +214,8 @@ ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment, { TyTy::BaseType *lookup = nullptr; bool ok = ctx->get_tyctx ()->lookup_type (mappings.get_hirid (), &lookup); - rust_assert (ok); + if (!ok) + return error_mark_node; // need to look up the reference for this identifier -- 2.47.2