diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-09-03 18:18:49 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-09-03 18:18:49 +0800 |
commit | df7c1e4aae0d847fab34f50d24a8b881ce29d03a (patch) | |
tree | e0d6c3625065254115da6a6abd81156b7c118f8f /src | |
parent | 775e33423d98bf76c5658af59de65fac5cf93e87 (diff) | |
download | mrust-df7c1e4aae0d847fab34f50d24a8b881ce29d03a.tar.gz |
HIR Typecheck - Equate associated types in trait object unsize
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 13 |
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"); + } + } } } |