From 3398a7da29bb29a4094469f0aa0f5f6ede05685f Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Wed, 16 Oct 2024 00:40:01 -0400 Subject: [PATCH] Insert trait names during toplevel resolution 2.0 gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Insert trait names into the type namespace. Signed-off-by: Owen Avery --- 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 2193544a664..a5e6c83a037 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -120,6 +120,9 @@ TopLevel::visit (AST::Trait &trait) trait.insert_implict_self ( std::unique_ptr (implicit_self)); + insert_or_error_out (trait.get_identifier ().as_string (), trait, + Namespace::Types); + DefaultResolver::visit (trait); }