diff options
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-resolve-path.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index 6ca4d62..a1188e9 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -201,10 +201,6 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup, const Analysis::NodeMapping &mappings, location_t expr_locus, bool is_qualified_path) { - HirId parent_block; - HIR::ExternalItem *resolved_extern_item - = ctx->get_mappings ().lookup_hir_extern_item (ref, &parent_block); - bool is_hir_extern_item = resolved_extern_item != nullptr; bool is_fn = lookup->get_kind () == TyTy::TypeKind::FNDEF; if (auto resolved_item = ctx->get_mappings ().lookup_hir_item (ref)) { @@ -215,8 +211,10 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup, return CompileItem::compile (*resolved_item, ctx, lookup, true, expr_locus); } - else if (is_hir_extern_item) + else if (auto hir_extern_item + = ctx->get_mappings ().lookup_hir_extern_item (ref)) { + HIR::ExternalItem *resolved_extern_item = hir_extern_item->first; if (!lookup->has_substitutions_defined ()) return CompileExternItem::compile (resolved_extern_item, ctx, nullptr, true, expr_locus); |