diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-10-20 17:59:03 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-02-21 12:36:40 +0100 |
commit | 12e94515f894be4a178c1a03ce42a23701515ee0 (patch) | |
tree | 2a99f06168afa6c89450ecd5d40ca7d1faf1df01 /gcc | |
parent | 699e7e862763199a0360c47f6d5ddd26a21517ce (diff) | |
download | gcc-12e94515f894be4a178c1a03ce42a23701515ee0.zip gcc-12e94515f894be4a178c1a03ce42a23701515ee0.tar.gz gcc-12e94515f894be4a178c1a03ce42a23701515ee0.tar.bz2 |
gccrs: Add missing name resolution to Function type-path segments
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Add missing handling of
function case.
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 d227b8b..e5c712a 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; } |