aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-01-17 13:02:51 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-08-01 16:52:26 +0200
commitd9d7f79a422f8669a5a7e6d627c764ba9f3eded9 (patch)
tree4ae58cd2fa0de04620c960a45f86836b52da1fb9 /gcc/rust
parentf085a67ebb079431a202df822a15315e440ed456 (diff)
downloadgcc-d9d7f79a422f8669a5a7e6d627c764ba9f3eded9.zip
gcc-d9d7f79a422f8669a5a7e6d627c764ba9f3eded9.tar.gz
gcc-d9d7f79a422f8669a5a7e6d627c764ba9f3eded9.tar.bz2
gccrs: Add tuple struct constructor to value namespace
A tuple struct constructor should be inserted in the value namespace during name resolution in order to reject multiple definitions of the function. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add the struct constructor to the value namespace. gcc/testsuite/ChangeLog: * rust/compile/name_resolution22.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc3
1 files changed, 3 insertions, 0 deletions
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 6929bdb..4134b9a 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -337,6 +337,9 @@ TopLevel::visit (AST::TupleStruct &tuple_struct)
{
insert_or_error_out (tuple_struct.get_struct_name (), tuple_struct,
Namespace::Types);
+
+ insert_or_error_out (tuple_struct.get_struct_name (), tuple_struct,
+ Namespace::Values);
}
void