diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-10 21:09:02 +1000 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-10 21:09:02 +1000 |
commit | 56bb288ca62d4e219b8349e26dbbe531dcc977d2 (patch) | |
tree | 71cd32f98790efd5d80150aa58a7f95e932a78a9 /src | |
parent | 0e41a86b8f23c7165e88930af5b9d397f6b5d16c (diff) | |
download | mrust-56bb288ca62d4e219b8349e26dbbe531dcc977d2.tar.gz |
HIR Typecheck - Use Deref impl in autoderef
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/helpers.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index 40011a7a..e06aa296 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -1870,11 +1870,11 @@ const ::HIR::TypeRef* TraitResolution::autoderef(const Span& sp, const ::HIR::Ty else { bool succ = this->find_trait_impls(sp, this->m_crate.get_lang_item_path(sp, "deref"), ::HIR::PathParams {}, ty, [&](const auto&, const auto& args, const auto& types) { assert(args.m_types.size() == 0); - // TODO: Use `types` + tmp_type = types.at("Target").clone(); return true; }); if( succ ) { - TODO(sp, "Found a Deref impl for " << ty << ", use the output of it"); + return &tmp_type; } else { return nullptr; |