diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-10-20 17:59:03 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-10-20 17:59:03 +0100 |
commit | 8e09dfb538db9af6eb312ecd0a5a4e5931db201e (patch) | |
tree | 38a165cc2e9bf9a3214a6cd88c8ca1603bda9d21 /gcc | |
parent | 678bf852435aca6de25704ca417fab257fe03da9 (diff) | |
download | gcc-8e09dfb538db9af6eb312ecd0a5a4e5931db201e.zip gcc-8e09dfb538db9af6eb312ecd0a5a4e5931db201e.tar.gz gcc-8e09dfb538db9af6eb312ecd0a5a4e5931db201e.tar.bz2 |
Add missing name resolution to Function type-path segments
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-type.cc | 15 |
1 files changed, 14 insertions, 1 deletions
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<AST::TypePathSegmentFunction *> (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; } |