diff mbox series

[committed,06/88] gccrs: Add name resolution to generic argument associated item bindings

Message ID 20230405140411.3016563-7-arthur.cohen@embecosm.com
State New
Headers show
Series [committed,01/88] gccrs: fatal_error_flag: Fix typo in error message | expand

Commit Message

Arthur Cohen April 5, 2023, 2:02 p.m. UTC
From: Philip Herron <herron.philip@googlemail.com>

When specifying generic arguments to Traits we can also specify the
associated types using `<BindingName=i32>` syntax we need to add
name resolution to the type argument here and rely on the type
resolution pass to ensure the associated type exists and to setup the
associated types accordingly.

Addresses #1720

gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go): Add name resolution to
	Trait items.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
---
 gcc/rust/resolve/rust-ast-resolve-type.cc | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc
index 16d05f3792b..28ab0697431 100644
--- a/gcc/rust/resolve/rust-ast-resolve-type.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-type.cc
@@ -589,6 +589,11 @@  ResolveGenericArgs::go (AST::GenericArgs &generic_args,
 
       resolver.resolve_disambiguated_generic (arg);
     }
+
+  for (auto &binding : generic_args.get_binding_args ())
+    {
+      ResolveType::go (binding.get_type ().get ());
+    }
 }
 
 } // namespace Resolver