Commit Message
Arthur Cohen
Aug. 1, 2024, 2:57 p.m. UTC
From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> The type of constant item expression was not properly visited in the default resolver. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit constant item's types. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> --- gcc/rust/resolve/rust-default-resolver.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc index d805bc9a511..0c2576f6e75 100644 --- a/gcc/rust/resolve/rust-default-resolver.cc +++ b/gcc/rust/resolve/rust-default-resolver.cc @@ -464,7 +464,10 @@ DefaultResolver::visit (AST::EnumItemDiscriminant &item) void DefaultResolver::visit (AST::ConstantItem &item) { - auto expr_vis = [this, &item] () { item.get_expr ().accept_vis (*this); }; + auto expr_vis = [this, &item] () { + item.get_expr ().accept_vis (*this); + visit (item.get_type ()); + }; // FIXME: Why do we need a Rib here? ctx.scoped (Rib::Kind::Item, item.get_node_id (), expr_vis);