diff mbox series

[086/125] gccrs: Add tuple struct to the type namespace

Message ID 20240801145809.366388-88-arthur.cohen@embecosm.com
State New
Headers show
Series [001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work | expand

Commit Message

Arthur Cohen Aug. 1, 2024, 2:57 p.m. UTC
From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Only tuple struct constructor was added to the resolver.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
	Add tuple struct type to the resolver's context.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

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 75d9bb82131..820ba271ae0 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -81,8 +81,13 @@  void
 GlobbingVisitor::visit (AST::TupleStruct &tuple_struct)
 {
   if (tuple_struct.get_visibility ().is_public ())
-    ctx.insert_shadowable (tuple_struct.get_identifier (),
-			   tuple_struct.get_node_id (), Namespace::Values);
+    {
+      ctx.insert_shadowable (tuple_struct.get_identifier (),
+			     tuple_struct.get_node_id (), Namespace::Types);
+
+      ctx.insert_shadowable (tuple_struct.get_identifier (),
+			     tuple_struct.get_node_id (), Namespace::Values);
+    }
 }
 
 void