https://gcc.gnu.org/g:7f0763069f9d4bbd851623889d59c4d91758f60b
commit r15-2569-g7f0763069f9d4bbd851623889d59c4d91758f60b Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com> Date: Wed Jan 24 17:11:59 2024 +0100 gccrs: Add constant identifiers to the value namespace Constants could not be resolved without their identifier in the right scope. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add constant identifiers to the resolver. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com> Diff: --- gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc index b672d448151a..f65ec77331ce 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -401,6 +401,9 @@ TopLevel::visit (AST::Union &union_item) void TopLevel::visit (AST::ConstantItem &const_item) { + insert_or_error_out (const_item.get_identifier (), const_item, + Namespace::Values); + auto expr_vis = [this, &const_item] () { const_item.get_expr ().accept_vis (*this); };