diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-07 05:44:51 +1000 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-07 05:44:51 +1000 |
commit | f9c65798a26800cb2a24f827bcf8943e4a68775a (patch) | |
tree | 117872b3ab3cca0111786bbcd93cae1477d5161e /src | |
parent | f066bcb98c61febd82ae24498d4fbb71d89e45df (diff) | |
download | mrust-f9c65798a26800cb2a24f827bcf8943e4a68775a.tar.gz |
HIR Typecheck CS - Remove coercion if types are equal
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 789f8509..d0f15d10 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2312,6 +2312,10 @@ namespace { const auto& ty_r = context.m_ivars.get_type(node_ptr->m_res_type); TRACE_FUNCTION_F(v << " - " << ty << " := " << ty_r); + if( context.m_ivars.types_equal(ty, ty_r) ) { + return true; + } + // TODO: CoerceUnsized trait // 1. Check that the source type can coerce |