From a74368d639cec8794a2bfd6d8cc08e8812ec0aa1 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 9 Dec 2018 00:29:11 +0800 Subject: HIR - Don't yield impls for a unbounded ivar Self --- src/hir/hir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hir/hir.cpp b/src/hir/hir.cpp index fb0cdbd3..a0b2b21d 100644 --- a/src/hir/hir.cpp +++ b/src/hir/hir.cpp @@ -344,7 +344,8 @@ bool ::HIR::TraitImpl::matches_type(const ::HIR::TypeRef& type, ::HIR::t_cb_reso { // NOTE: Don't return any impls when the type is an unbouned ivar. Wouldn't be able to pick anything anyway // TODO: For `Unbound`, it could be valid, if the target is a generic. - if( /*is_unbounded_infer(type) ||*/ TU_TEST1(type.m_data, Path, .binding.is_Unbound()) ) { + // - Pure infer could also be useful (for knowing if there's any other potential impls) + if( is_unbounded_infer(type) || TU_TEST1(type.m_data, Path, .binding.is_Unbound()) ) { return false; } return matches_type_int(m_params, m_type, type, ty_res, true); -- cgit v1.2.3