diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-05 19:07:38 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-05 19:07:38 +0800 |
commit | 3ee9d5c193e5177e695ae237ab2c28c225619ff2 (patch) | |
tree | 8515d4b1b9008b8f61e0e8f9e9e29b9624b22cc2 /src | |
parent | 4682461ca4621fa0c297a23616f25b5f3f7a37f3 (diff) | |
download | mrust-3ee9d5c193e5177e695ae237ab2c28c225619ff2.tar.gz |
HIR Typecheck Validate - Allow no-op casts
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/expr_check.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hir_typeck/expr_check.cpp b/src/hir_typeck/expr_check.cpp index 2f962f71..4f4235cd 100644 --- a/src/hir_typeck/expr_check.cpp +++ b/src/hir_typeck/expr_check.cpp @@ -243,6 +243,12 @@ namespace { const auto& src_ty = node.m_value->m_res_type; const auto& dst_ty = node.m_res_type; + + if( dst_ty == src_ty ) { + // Would be nice to delete it, but this is a readonly pass + return ; + } + // Check castability TU_MATCH_DEF(::HIR::TypeRef::Data, (dst_ty.m_data), (de), ( |