aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-resolve-path.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-10-20 17:19:32 +0100
committerPhilip Herron <philip.herron@embecosm.com>2021-10-22 10:49:29 +0100
commit7d988344f74681b0fa97ada77e8390c8e4d69147 (patch)
treeafbe7c8869e6f5bf98dcaf2d6e1cdcc883025ec5 /gcc/rust/backend/rust-compile-resolve-path.cc
parente9b10b3d2992eeb360527c103f1bf9a455f2a593 (diff)
downloadgcc-7d988344f74681b0fa97ada77e8390c8e4d69147.zip
gcc-7d988344f74681b0fa97ada77e8390c8e4d69147.tar.gz
gcc-7d988344f74681b0fa97ada77e8390c8e4d69147.tar.bz2
Cleanup interfaces for associated impl mappings
This changes the lookups to return boolean if they are found rather than default UNKNOWN_HIRID which is more ambigious.
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
-rw-r--r--gcc/rust/backend/rust-compile-resolve-path.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index 98c04df..9e8236c 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.cc
+++ b/gcc/rust/backend/rust-compile-resolve-path.cc
@@ -197,11 +197,11 @@ ResolvePathRef::query_compile (HirId ref, TyTy::BaseType *lookup,
Analysis::NodeMapping trait_mappings
= trait_item_ref->get_parent_trait_mappings ();
- auto associated_impl_id
- = ctx->get_tyctx ()->lookup_associated_impl_mapping_for_self (
- trait_mappings.get_hirid (), receiver);
- rust_assert (associated_impl_id != UNKNOWN_HIRID);
+ HirId associated_impl_id;
+ ok = ctx->get_tyctx ()->lookup_associated_impl_mapping_for_self (
+ trait_mappings.get_hirid (), receiver, &associated_impl_id);
+ rust_assert (ok);
Resolver::AssociatedImplTrait *associated = nullptr;
bool found_associated_trait_impl