public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/rust/master] Add constant identifiers to the value namespace
Date: Tue,  7 May 2024 16:27:44 +0000 (GMT)	[thread overview]
Message-ID: <20240507162744.69A37386F83A@sourceware.org> (raw)

https://gcc.gnu.org/g:b0f27e8d81f241d66300a066ac6a133c6347ae4f

commit b0f27e8d81f241d66300a066ac6a133c6347ae4f
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed Jan 24 17:11:59 2024 +0100

    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.patry@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); };

                 reply	other threads:[~2024-05-07 16:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240507162744.69A37386F83A@sourceware.org \
    --to=tschwinge@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).