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.
This commit is contained in:
Philip Herron
2022-10-20 17:59:03 +01:00
committed by Arthur Cohen
parent 699e7e8627
commit 12e94515f8

View File

@@ -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 &param : fn.get_params ())
{
ResolveType::go (param.get ());
}
if (fn.has_return_type ())
{
ResolveType::go (fn.get_return_type ().get ());
}
break;
}