From: Philip Herron <[email protected]>
gcc/rust/ChangeLog:
* typecheck/rust-type-util.cc (lookup_associated_impl_block): add filter
(normalize_projection): likewise
Signed-off-by: Philip Herron <[email protected]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/c1f7a083666fabd2e18847aa7b51bad69565e574
The commit has NOT been mentioned in any issue.
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/4816
gcc/rust/typecheck/rust-type-util.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/typecheck/rust-type-util.cc
b/gcc/rust/typecheck/rust-type-util.cc
index 4a6f444be..97ff25d43 100644
--- a/gcc/rust/typecheck/rust-type-util.cc
+++ b/gcc/rust/typecheck/rust-type-util.cc
@@ -382,7 +382,8 @@ lookup_associated_impl_block (const
TyTy::TypeBoundPredicate &bound,
// setup any associated type mappings for the specified bonds and this
// type
- auto candidates = TypeBoundsProbe::Probe (binding);
+ auto candidates
+ = TypeBoundsProbe::Probe (binding, bound.get ()->get_hir_trait_ref ());
std::vector<AssociatedImplTrait *> associated_impl_traits;
for (auto &probed_bound : candidates)
{
@@ -669,7 +670,8 @@ normalize_projection (TyTy::ProjectionType *proj,
location_t locus,
&& self->get_kind () != TyTy::TypeKind::INFER
&& self->get_kind () != TyTy::TypeKind::PROJECTION)
{
- auto candidates = TypeBoundsProbe::Probe (self);
+ auto candidates = TypeBoundsProbe::Probe (
+ self, proj->get_trait_ref ()->get_hir_trait_ref ());
for (auto &probed : candidates)
{
HIR::ImplBlock *impl_block = probed.second;
--
2.55.0