summaryrefslogtreecommitdiff
path: root/src/hir_typeck
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-09-03 18:18:49 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-09-03 18:18:49 +0800
commitdf7c1e4aae0d847fab34f50d24a8b881ce29d03a (patch)
treee0d6c3625065254115da6a6abd81156b7c118f8f /src/hir_typeck
parent775e33423d98bf76c5658af59de65fac5cf93e87 (diff)
downloadmrust-df7c1e4aae0d847fab34f50d24a8b881ce29d03a.tar.gz
HIR Typecheck - Equate associated types in trait object unsize
Diffstat (limited to 'src/hir_typeck')
-rw-r--r--src/hir_typeck/expr_cs.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index f4504364..cb40e6b4 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -4478,6 +4478,19 @@ namespace {
{
context.equate_types(sp, trait.m_params.m_types[i], args.m_types[i]);
}
+ for(const auto& tyb : dep->m_trait.m_type_bounds)
+ {
+ auto ty = best_impl.get_type(tyb.first.c_str());
+ if( ty != ::HIR::TypeRef() )
+ {
+ context.equate_types(sp, tyb.second, ty);
+ }
+ else
+ {
+ // Error? Log? ...
+ DEBUG("Associated type " << tyb.first << " not present in impl, can't equate");
+ }
+ }
}
}