From 8e09dfb538db9af6eb312ecd0a5a4e5931db201e Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Thu, 20 Oct 2022 17:59:03 +0100 Subject: Add missing name resolution to Function type-path segments --- gcc/rust/resolve/rust-ast-resolve-type.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'gcc/rust/resolve') diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc index 6b08613..e42bab6 100644 --- a/gcc/rust/resolve/rust-ast-resolve-type.cc +++ b/gcc/rust/resolve/rust-ast-resolve-type.cc @@ -149,7 +149,20 @@ ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id) break; case AST::TypePathSegment::SegmentType::FUNCTION: - gcc_unreachable (); + AST::TypePathSegmentFunction *fnseg + = static_cast (segment.get ()); + + AST::TypePathFunction &fn = fnseg->get_type_path_function (); + for (auto ¶m : fn.get_params ()) + { + ResolveType::go (param.get ()); + } + + if (fn.has_return_type ()) + { + ResolveType::go (fn.get_return_type ().get ()); + } + break; } -- cgit v1.1