summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-07-10 21:09:02 +1000
committerJohn Hodge <tpg@mutabah.net>2016-07-10 21:09:02 +1000
commit56bb288ca62d4e219b8349e26dbbe531dcc977d2 (patch)
tree71cd32f98790efd5d80150aa58a7f95e932a78a9 /src
parent0e41a86b8f23c7165e88930af5b9d397f6b5d16c (diff)
downloadmrust-56bb288ca62d4e219b8349e26dbbe531dcc977d2.tar.gz
HIR Typecheck - Use Deref impl in autoderef
Diffstat (limited to 'src')
-rw-r--r--src/hir_typeck/helpers.cpp4
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;