https://gcc.gnu.org/g:aaa386a063ba602c8caca52d71321e3fd8304bba

commit r17-4297-gaaa386a063ba602c8caca52d71321e3fd8304bba
Author: Philip Herron <[email protected]>
Date:   Sun Aug 23 22:02:34 2026 +0100

    gccrs: add more bound filtering
    
    gcc/rust/ChangeLog:
    
            * typecheck/rust-type-util.cc (lookup_associated_impl_block): add 
filter
            (normalize_projection): likewise
    
    Signed-off-by: Philip Herron <[email protected]>

Diff:
---
 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 4a6f444beeda..97ff25d43685 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;

Reply via email to