aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/tree/rust-hir-expr.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-10-18 13:21:40 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:39 +0100
commit740a1997228d0b568afa11b1afe89128d9afff37 (patch)
tree0aa7fde752e1fcc0dd946a743836fb30ad215460 /gcc/rust/hir/tree/rust-hir-expr.h
parent898240946ca2e351889015d36a60498e40b4a9fc (diff)
downloadgcc-740a1997228d0b568afa11b1afe89128d9afff37.zip
gcc-740a1997228d0b568afa11b1afe89128d9afff37.tar.gz
gcc-740a1997228d0b568afa11b1afe89128d9afff37.tar.bz2
gccrs: Initial Type resolution for closures
gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h: Add `get_params` method. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Typecheck closure nodes. (TypeCheckExpr::resolve_fn_trait_call): New function. * typecheck/rust-hir-type-check-expr.h: Declare `resolve_fn_trait_call` and `resolve_possible_fn_trait_call_method_name`. * typecheck/rust-hir-type-check.h: Declare `get_context_type`. * typecheck/rust-tyctx.cc (TypeCheckContextItem::get_context_type): New function. * typecheck/rust-tyty-cmp.h: Visit closures properly. * typecheck/rust-tyty-rules.h: Likewise. * typecheck/rust-tyty.cc (BaseType::bounds_compatible): Add commented out assertin. (ClosureType::as_string): Implement it. (ClosureType::clone): Fix closure cloning. (ClosureType::setup_fn_once_output): New function. * typecheck/rust-tyty.h: Improve `ClosureType` class and declare `setup_fn_once_output`.
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir-expr.h')
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index 4c5caf1..227bacb 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -2131,6 +2131,8 @@ public:
};
std::unique_ptr<Expr> &get_expr () { return expr; }
+ std::vector<ClosureParam> &get_params () { return params; }
+
void accept_vis (HIRFullVisitor &vis) override;
void accept_vis (HIRExpressionVisitor &vis) override;