]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove query mode on CompileItem
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 12 Dec 2024 12:16:14 +0000 (13:16 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Mar 2025 12:06:56 +0000 (13:06 +0100)
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 <pierre-emmanuel.patry@embecosm.com>
gcc/rust/backend/rust-compile-item.h
gcc/rust/backend/rust-compile-resolve-path.cc

index efc65fe0d5e46eb80f8fbfa10829525a13d58572..eccb040bc93d741fe0455eb342232146793fd704 100644 (file)
@@ -31,15 +31,13 @@ protected:
 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;
   }
index 6ede1bea22f47a13084d8267c8334e8389e72544..a40f5542a683560421280aaa861bfc56a5777752 100644 (file)
@@ -240,11 +240,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))