aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYizhe <yizhe@pku.edu.cn>2021-03-17 07:24:46 +0000
committerYizhePKU <yizhe@pku.edu.cn>2021-04-02 17:10:46 +0000
commit63697c37cf329e3b265ff4eaa16a6efd28f2a38b (patch)
treea63c6c8cdf679d931f313a148cdab39710f03a86
parentf12d8b770b236142b64a4dd542d3c157e8cc4293 (diff)
downloadgcc-63697c37cf329e3b265ff4eaa16a6efd28f2a38b.zip
gcc-63697c37cf329e3b265ff4eaa16a6efd28f2a38b.tar.gz
gcc-63697c37cf329e3b265ff4eaa16a6efd28f2a38b.tar.bz2
Add the new InferType to lookup table
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-expr.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h
index a734dcf..df5c47a 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h
@@ -706,10 +706,16 @@ public:
return true;
});
- // Create an infer type and register its hir_id
+ // Create an infer type and register it in TypeCheckContext
+ // TODO: This is very leaky. Need a refactor of some sort.
+ auto crateNum = Analysis::Mappings::get ()->get_current_crate ();
+ auto nodeId = UNKNOWN_NODEID;
+ auto hirId = mappings->get_next_hir_id ();
+ auto localDefId = UNKNOWN_LOCAL_DEFID;
+ auto mappings = Analysis::NodeMapping (crateNum, nodeId, hirId, localDefId);
infered_array_elems
- = new TyTy::InferType (mappings->get_next_hir_id (),
- TyTy::InferType::InferTypeKind::GENERAL);
+ = new TyTy::InferType (hirId, TyTy::InferType::InferTypeKind::GENERAL);
+ context->insert_type (mappings, infered_array_elems);
for (auto &type : types)
{