gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check.h: new helper
* typecheck/rust-typecheck-context.cc (TypeCheckContext::have_function_context):
implementation
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
void insert_type_by_node_id (NodeId ref, HirId id);
bool lookup_type_by_node_id (NodeId ref, HirId *id);
+ bool have_function_context () const;
TyTy::BaseType *peek_return_type ();
TypeCheckContextItem peek_context ();
void push_return_type (TypeCheckContextItem item,
return true;
}
+bool
+TypeCheckContext::have_function_context () const
+{
+ return !return_type_stack.empty ();
+}
+
TyTy::BaseType *
TypeCheckContext::peek_return_type ()
{