From aed875deb2bd9ea306ad9ee64f892ddc4385b306 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 1 Oct 2017 16:37:15 +0800 Subject: Typecheck Expressions - Don't pick a bound impl when type is Unbound UFCS --- src/hir_typeck/helpers.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index 6eaf8528..660127fc 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -2204,6 +2204,8 @@ bool TraitResolution::find_trait_impls_bound(const Span& sp, const ::HIR::Simple if( m_ivars.get_type(type).m_data.is_Infer() ) return false; + if( TU_TEST1(m_ivars.get_type(type).m_data, Path, .binding.is_Unbound()) ) + return false; // TODO: A bound can imply something via its associated types. How deep can this go? // E.g. `T: IntoIterator` implies `::IntoIter : Iterator` -- cgit v1.2.3