aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorYizhePKU <yizhe@pku.edu.cn>2021-04-08 04:02:50 +0000
committerYizhePKU <yizhe@pku.edu.cn>2021-04-08 04:02:50 +0000
commit5da07eb33b5453c932ab1248629d9feebf0da6b1 (patch)
treedfd1492e58dab916f14552d2f3327ff72094875c /gcc/rust
parenta707707b97caa896e807db00213381d9b418c2cd (diff)
downloadgcc-5da07eb33b5453c932ab1248629d9feebf0da6b1.zip
gcc-5da07eb33b5453c932ab1248629d9feebf0da6b1.tar.gz
gcc-5da07eb33b5453c932ab1248629d9feebf0da6b1.tar.bz2
Use TyVar::get_implict_infer_var to cleanup
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-expr.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h
index df5c47a..b6048a9 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h
@@ -706,16 +706,7 @@ public:
return true;
});
- // 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 (hirId, TyTy::InferType::InferTypeKind::GENERAL);
- context->insert_type (mappings, infered_array_elems);
+ infered_array_elems = TyTy::TyVar::get_implict_infer_var ().get_tyty ();
for (auto &type : types)
{