]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix bug with unconstrained const generic
authorPhilip Herron <herron.philip@googlemail.com>
Sun, 3 Aug 2025 18:43:13 +0000 (19:43 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 19:59:03 +0000 (20:59 +0100)
gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-base.cc (walk_types_to_constrain): track the ref as well

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-type-check-base.cc

index 8810ef458082a4a980f58cea13331001ae5e5f38..ebe7fad713c7b010e18e56e40891f5439f9f0809 100644 (file)
@@ -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