summaryrefslogtreecommitdiff
path: root/src/hir/type.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-04-20 11:50:34 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-04-20 11:50:34 +0800
commit7dca0b4a6ff1158edf1ab17772e96bab488c1b32 (patch)
tree107a4bce0e0cb8c4bc81325acfa107e24ffbb1ec /src/hir/type.cpp
parentb82f4f8d88fc533b75cb552dad39f49fad164c49 (diff)
downloadmrust-7dca0b4a6ff1158edf1ab17772e96bab488c1b32.tar.gz
HIR Typecheck - Bulk commit of typecheck fixes, less magic
Diffstat (limited to 'src/hir/type.cpp')
-rw-r--r--src/hir/type.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/hir/type.cpp b/src/hir/type.cpp
index ff4742e6..ccd5cd21 100644
--- a/src/hir/type.cpp
+++ b/src/hir/type.cpp
@@ -789,6 +789,20 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x
assert(!"Fell off end of clone_binding");
throw "";
}
+bool HIR::TypeRef::TypePathBinding::operator==(const HIR::TypeRef::TypePathBinding& x) const
+{
+ if( this->tag() != x.tag() )
+ return false;
+ TU_MATCH(::HIR::TypeRef::TypePathBinding, (*this, x), (te, xe),
+ (Unbound, return true;),
+ (Opaque, return true;),
+ (ExternType, return te == xe;),
+ (Struct, return te == xe;),
+ (Union , return te == xe;),
+ (Enum , return te == xe;)
+ )
+ throw "";
+}
::HIR::TypeRef HIR::TypeRef::clone() const