summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-12-09 09:06:06 +0800
committerJohn Hodge <tpg@mutabah.net>2018-12-09 09:06:06 +0800
commitc071e39c9d5b5d28863471e32607acf932cf3c10 (patch)
tree958a4e3c872ebf0da8359fedb0bebc43a4004ae3
parent880d23e75d2408a1b8ce9bc545241c17a48e8f3c (diff)
downloadmrust-c071e39c9d5b5d28863471e32607acf932cf3c10.tar.gz
HIR Typecheck - Hack when method resolution finds both a bound and an available trait
-rw-r--r--src/hir_typeck/expr_cs.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index 23deda62..13eabe9c 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -2745,7 +2745,14 @@ namespace {
trait_params.m_types.push_back( ::HIR::TypeRef::new_infer(ivars[i], ::HIR::InferClass::None) );
//ASSERT_BUG(sp, m_ivars.get_type( trait_params.m_types.back() ).m_data.as_Infer().index == ivars[i], "A method selection ivar was bound");
}
- e1.trait.m_params = mv$(trait_params);
+ // If one of these was already using the placeholder ivars, then maintain the other one?
+ if( e2.trait.m_params == trait_params )
+ {
+ }
+ else
+ {
+ e1.trait.m_params = mv$(trait_params);
+ }
it_2 = possible_methods.erase(it_2) - 1;
}