diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-22 15:46:34 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-22 16:00:27 +0800 |
commit | 8fbd89944343d479977d2c8d0b0f3fb329299763 (patch) | |
tree | c742f92dcf07180527b4073cbdca616e8f14d21d /src/hir/type.cpp | |
parent | 074cef4835dd2ade75ed2a3d7e44e02883de631c (diff) | |
download | mrust-8fbd89944343d479977d2c8d0b0f3fb329299763.tar.gz |
HIR Types - Treat unbound path types as fuzzy matches in compare_with_placeholders
Diffstat (limited to 'src/hir/type.cpp')
-rw-r--r-- | src/hir/type.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hir/type.cpp b/src/hir/type.cpp index 76154008..6f465c44 100644 --- a/src/hir/type.cpp +++ b/src/hir/type.cpp @@ -932,6 +932,12 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x // - See `(Generic,` below if( left.m_data.tag() != right.m_data.tag() ) { + if( left.m_data.is_Path() && left.m_data.as_Path().binding.is_Unbound() ) { + return Compare::Fuzzy; + } + if( right.m_data.is_Path() && right.m_data.as_Path().binding.is_Unbound() ) { + return Compare::Fuzzy; + } return Compare::Unequal; } TU_MATCH(::HIR::TypeRef::Data, (left.m_data, right.m_data), (le, re), |