From: Philip Herron Date: Sun, 3 Aug 2025 18:43:13 +0000 (+0100) Subject: gccrs: Fix bug with unconstrained const generic X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73512d1d01258277e383092e59e7b52447f512fc;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/typecheck/rust-hir-type-check-base.cc b/gcc/rust/typecheck/rust-hir-type-check-base.cc index 8810ef45808..ebe7fad713c 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 &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