diff options
-rw-r--r-- | src/hir/type.cpp | 4 | ||||
-rw-r--r-- | src/hir_typeck/helpers.cpp | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/hir/type.cpp b/src/hir/type.cpp index fafbc670..b430f2b5 100644 --- a/src/hir/type.cpp +++ b/src/hir/type.cpp @@ -648,6 +648,10 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x if( te.binding.is_Unbound() || xe.binding.is_Unbound() ) { rv = ::HIR::Compare::Fuzzy; } + if( te.binding.is_Opaque() ) { + DEBUG("- Fuzzy match due to opaque"); + return Compare::Fuzzy; + } } return rv; ), diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index b6b81efc..fa9a6a67 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -2692,6 +2692,7 @@ bool TraitResolution::find_trait_impls_crate(const Span& sp, return ::HIR::Compare::Equal; } else { + DEBUG("[ftic_check_params] Param " << idx << " " << *impl_params[idx] << " == " << ty); return impl_params[idx]->compare_with_placeholders(sp, ty, this->m_ivars.callback_resolve_infer()); } }; @@ -2716,16 +2717,16 @@ bool TraitResolution::find_trait_impls_crate(const Span& sp, const auto& params = *params_ptr; ASSERT_BUG(sp, impl_trait_args.m_types.size() == params.m_types.size(), "Param count mismatch between `" << impl_trait_args << "` and `" << params << "` for " << trait ); for(unsigned int i = 0; i < impl_trait_args.m_types.size(); i ++) - match &= impl_trait_args.m_types[i].match_test_generics_fuzz(sp, params.m_types[i], this->m_ivars.callback_resolve_infer(), cb); + match &= impl_trait_args.m_types[i] .match_test_generics_fuzz(sp, params.m_types[i], this->m_ivars.callback_resolve_infer(), cb); if( match == ::HIR::Compare::Unequal ) { - DEBUG("[find_trait_impls_crate] - Failed to match parameters - " << impl_trait_args << "+" << impl_ty << " != " << params << "+" << type); + DEBUG("- Failed to match parameters - " << impl_trait_args << "+" << impl_ty << " != " << params << "+" << type); return ::HIR::Compare::Unequal; } } else { if( match == ::HIR::Compare::Unequal ) { - DEBUG("[find_trait_impls_crate] - Failed to match type - " << impl_ty << " != " << type); + DEBUG("- Failed to match type - " << impl_ty << " != " << type); return ::HIR::Compare::Unequal; } } |