aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2025-02-03 15:15:40 +0000
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-24 13:07:01 +0100
commit3057b8a897aad30e1028cffb61e6568703b1fc09 (patch)
treec289e54066301f9f03af4105dced792659b40de5 /gcc
parent0eddc297f03ae2a0830ad444f1f4d2a4264f5ad7 (diff)
downloadgcc-3057b8a897aad30e1028cffb61e6568703b1fc09.zip
gcc-3057b8a897aad30e1028cffb61e6568703b1fc09.tar.gz
gcc-3057b8a897aad30e1028cffb61e6568703b1fc09.tar.bz2
gccrs: Fix ICE during path probe
It is valid for the query to fail here so its valid to not assert here. gcc/rust/ChangeLog: * typecheck/rust-hir-path-probe.cc (PathProbeType::visit): remove assertion Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-hir-path-probe.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/rust/typecheck/rust-hir-path-probe.cc b/gcc/rust/typecheck/rust-hir-path-probe.cc
index 1148b24..0465d2f 100644
--- a/gcc/rust/typecheck/rust-hir-path-probe.cc
+++ b/gcc/rust/typecheck/rust-hir-path-probe.cc
@@ -212,8 +212,8 @@ PathProbeType::visit (HIR::TypeAlias &alias)
{
HirId tyid = alias.get_mappings ().get_hirid ();
TyTy::BaseType *ty = nullptr;
- bool ok = query_type (tyid, &ty);
- rust_assert (ok);
+ if (!query_type (tyid, &ty))
+ return;
PathProbeCandidate::ImplItemCandidate impl_item_candidate{&alias,
current_impl};
@@ -232,8 +232,8 @@ PathProbeType::visit (HIR::ConstantItem &constant)
{
HirId tyid = constant.get_mappings ().get_hirid ();
TyTy::BaseType *ty = nullptr;
- bool ok = query_type (tyid, &ty);
- rust_assert (ok);
+ if (!query_type (tyid, &ty))
+ return;
PathProbeCandidate::ImplItemCandidate impl_item_candidate{&constant,
current_impl};
@@ -252,8 +252,8 @@ PathProbeType::visit (HIR::Function &function)
{
HirId tyid = function.get_mappings ().get_hirid ();
TyTy::BaseType *ty = nullptr;
- bool ok = query_type (tyid, &ty);
- rust_assert (ok);
+ if (!query_type (tyid, &ty))
+ return;
PathProbeCandidate::ImplItemCandidate impl_item_candidate{&function,
current_impl};