Skip to content

Commit 793fed8

Browse files
committed
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]>
1 parent 0f46e85 commit 793fed8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gcc/rust/typecheck/rust-hir-type-check-base.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ walk_types_to_constrain (std::set<HirId> &constrained_symbols,
5656
if (arg != nullptr)
5757
{
5858
const auto p = arg->get_root ();
59+
constrained_symbols.insert (p->get_ref ());
5960
constrained_symbols.insert (p->get_ty_ref ());
61+
6062
if (p->has_substitutions_defined ())
6163
{
6264
walk_types_to_constrain (constrained_symbols,
@@ -164,8 +166,6 @@ TypeCheckBase::check_for_unconstrained (
164166
HirId ref = p.get_param_ty ()->get_ref ();
165167
symbols_to_constrain.insert (ref);
166168
symbol_to_location.insert ({ref, p.get_param_locus ()});
167-
168-
rust_debug_loc (p.get_param_locus (), "XX constrain THIS");
169169
}
170170

171171
// set up the set of constrained symbols

0 commit comments

Comments
 (0)