https://gcc.gnu.org/g:73512d1d01258277e383092e59e7b52447f512fc

commit r16-4840-g73512d1d01258277e383092e59e7b52447f512fc
Author: Philip Herron <[email protected]>
Date:   Sun Aug 3 19:43:13 2025 +0100

    gccrs: Fix bug with unconstrained const generic
    
    gcc/rust/ChangeLog:
    
            * typecheck/rust-hir-type-check-base.cc (walk_types_to_constrain): 
track the ref as well
    
    Signed-off-by: Philip Herron <[email protected]>

Diff:
---
 gcc/rust/typecheck/rust-hir-type-check-base.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-base.cc 
b/gcc/rust/typecheck/rust-hir-type-check-base.cc
index 8810ef458082..ebe7fad713c7 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-base.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-base.cc
@@ -56,7 +56,9 @@ walk_types_to_constrain (std::set<HirId> &constrained_symbols,
       if (arg != nullptr)
        {
          const auto p = arg->get_root ();
+         constrained_symbols.insert (p->get_ref ());
          constrained_symbols.insert (p->get_ty_ref ());
+
          if (p->has_substitutions_defined ())
            {
              walk_types_to_constrain (constrained_symbols,
@@ -164,8 +166,6 @@ TypeCheckBase::check_for_unconstrained (
       HirId ref = p.get_param_ty ()->get_ref ();
       symbols_to_constrain.insert (ref);
       symbol_to_location.insert ({ref, p.get_param_locus ()});
-
-      rust_debug_loc (p.get_param_locus (), "XX constrain THIS");
     }
 
   // set up the set of constrained symbols

Reply via email to