From 9957c24448ceee4ddb31c57db02a6daae1acdfe5 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Thu, 12 Dec 2024 13:16:14 +0100 Subject: [PATCH] Remove query mode on CompileItem Query mode was a hack to catch up some compile errors early, it was deemed to be removed at some time. Recent changes to NR1 highlighted an incompatibility with it hence it's removal. gcc/rust/ChangeLog: * backend/rust-compile-item.h: Remove query mode. * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): Likewise. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/backend/rust-compile-item.h | 6 ++---- gcc/rust/backend/rust-compile-resolve-path.cc | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gcc/rust/backend/rust-compile-item.h b/gcc/rust/backend/rust-compile-item.h index 1c877fa328dc..70660e16147c 100644 --- a/gcc/rust/backend/rust-compile-item.h +++ b/gcc/rust/backend/rust-compile-item.h @@ -31,15 +31,13 @@ class CompileItem : private HIRCompileBase, protected HIR::HIRStmtVisitor public: static tree compile (HIR::Item *item, Context *ctx, TyTy::BaseType *concrete = nullptr, - bool is_query_mode = false, location_t ref_locus = UNDEF_LOCATION) { CompileItem compiler (ctx, concrete, ref_locus); item->accept_vis (compiler); - if (is_query_mode && compiler.reference == error_mark_node) - rust_internal_error_at (ref_locus, "failed to compile item: %s", - item->as_string ().c_str ()); + if (compiler.reference == error_mark_node) + rust_debug ("failed to compile item: %s", item->as_string ().c_str ()); return compiler.reference; } diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index 5f6ba7cce433..170dde6055de 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -205,11 +205,9 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup, if (auto resolved_item = ctx->get_mappings ().lookup_hir_item (ref)) { if (!lookup->has_substitutions_defined ()) - return CompileItem::compile (*resolved_item, ctx, nullptr, true, - expr_locus); + return CompileItem::compile (*resolved_item, ctx, nullptr, expr_locus); else - return CompileItem::compile (*resolved_item, ctx, lookup, true, - expr_locus); + return CompileItem::compile (*resolved_item, ctx, lookup, expr_locus); } else if (auto hir_extern_item = ctx->get_mappings ().lookup_hir_extern_item (ref))