aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-resolve-path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
-rw-r--r--gcc/rust/backend/rust-compile-resolve-path.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index 69599cc..d248ee2 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.cc
+++ b/gcc/rust/backend/rust-compile-resolve-path.cc
@@ -248,12 +248,9 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
return CompileInherentImplItem::Compile (resolved_item->first, ctx,
lookup, true, expr_locus);
}
- else
+ else if (auto trait_item
+ = ctx->get_mappings ().lookup_hir_trait_item (ref))
{
- // it might be resolved to a trait item
- tl::optional<HIR::TraitItem *> trait_item
- = ctx->get_mappings ().lookup_hir_trait_item (ref);
-
HIR::Trait *trait = ctx->get_mappings ().lookup_trait_item_mapping (
trait_item.value ()->get_mappings ().get_hirid ());