summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-07-07 19:10:10 +1000
committerJohn Hodge <tpg@mutabah.net>2016-07-07 19:10:10 +1000
commit01855eb0d44ca9b30f8a4a9604dadfa9eb55e218 (patch)
tree3f821cec7f2228abfb43129e553bd70dbbd23350
parent15af300790fab5663f480aca06887062e7517604 (diff)
downloadmrust-01855eb0d44ca9b30f8a4a9604dadfa9eb55e218.tar.gz
HIR Type - Mark the same ivar as being the Equal
-rw-r--r--src/hir/type.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/hir/type.cpp b/src/hir/type.cpp
index 70ce2599..3bdff34e 100644
--- a/src/hir/type.cpp
+++ b/src/hir/type.cpp
@@ -515,6 +515,11 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x
//const auto& left = *this;
const auto& right = (x.m_data.is_Infer() ? resolve_placeholder(x) : (x.m_data.is_Generic() ? resolve_placeholder(x) : x));
+ // If the two types are the same ivar, return equal
+ if( left.m_data.is_Infer() && left == right ) {
+ return Compare::Equal;
+ }
+
// If left is infer
TU_IFLET(::HIR::TypeRef::Data, left.m_data, Infer, e,
switch(e.ty_class)