diff options
author | John Hodge <tpg@mutabah.net> | 2018-12-09 00:29:11 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-12-09 00:29:11 +0800 |
commit | a74368d639cec8794a2bfd6d8cc08e8812ec0aa1 (patch) | |
tree | d9c155344591dc45ef91f6ebcffc044ae717edd9 /src | |
parent | e4f9ba0abf4646687e38d0eed15ebd19b514910b (diff) | |
download | mrust-a74368d639cec8794a2bfd6d8cc08e8812ec0aa1.tar.gz |
HIR - Don't yield impls for a unbounded ivar Self
Diffstat (limited to 'src')
-rw-r--r-- | src/hir/hir.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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); |