aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2025-07-18 16:44:36 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2025-08-05 16:36:56 +0200
commit1490b80bd143b8808678e9449b070d5f18ac588c (patch)
tree2ba5a03052310ebdef4a4b1f2f0e06bf9cc6b1c5
parent9076a8f688886de933d5f953855a3431d3e0a922 (diff)
downloadgcc-1490b80bd143b8808678e9449b070d5f18ac588c.zip
gcc-1490b80bd143b8808678e9449b070d5f18ac588c.tar.gz
gcc-1490b80bd143b8808678e9449b070d5f18ac588c.tar.bz2
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 <herron.philip@googlemail.com>
-rw-r--r--gcc/rust/backend/rust-compile-resolve-path.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index a80484a..6d92c0c 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