]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add name resolution to generic argument associated item bindings
authorPhilip Herron <herron.philip@googlemail.com>
Sat, 7 Jan 2023 17:15:23 +0000 (17:15 +0000)
committerPhilip Herron <herron.philip@googlemail.com>
Tue, 10 Jan 2023 22:12:16 +0000 (22:12 +0000)
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

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

* resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go):

gcc/rust/resolve/rust-ast-resolve-type.cc

index 76eb93b9c38a6af260411648484b79dfce0d7b34..784660398331e53db7b1a0592599a56a276eb11e 100644 (file)
@@ -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