summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-08-19 22:12:00 +0800
committerJohn Hodge <tpg@mutabah.net>2017-08-19 22:12:00 +0800
commit6056c2e4c59164f13c4ac5d514319a3ac0c7ed4c (patch)
tree13330ff9681bfe5dc071d6a5672e4a5692ae5806 /src
parenta3ca810d74c09235cbd501f606ed1b979691aba3 (diff)
downloadmrust-6056c2e4c59164f13c4ac5d514319a3ac0c7ed4c.tar.gz
HIR Typecheck - Work around VS quirks with macros.
Diffstat (limited to 'src')
-rw-r--r--src/hir_typeck/helpers.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp
index dab633ec..2ebdb44d 100644
--- a/src/hir_typeck/helpers.cpp
+++ b/src/hir_typeck/helpers.cpp
@@ -934,10 +934,9 @@ void TraitResolution::prep_indexes()
};
this->iterate_bounds([&](const auto& b)->bool {
- TU_MATCH_DEF(::HIR::GenericBound, (b), (be),
- (
- ),
- (TraitBound,
+ if(const auto* bep = b.opt_TraitBound())
+ {
+ const auto& be = *bep;
DEBUG("[prep_indexes] `" << be.type << " : " << be.trait);
// Explicitly listed bounds
for( const auto& tb : be.trait.m_type_bounds ) {
@@ -1000,12 +999,16 @@ void TraitResolution::prep_indexes()
}
}
}
- ),
- (TypeEquality,
+ }
+ else if(const auto* bep = b.opt_TypeEquality())
+ {
+ const auto& be = *bep;
DEBUG("Equality - " << be.type << " = " << be.other_type);
add_equality( be.type.clone(), be.other_type.clone() );
- )
- )
+ }
+ else
+ {
+ }
return false;
});
}