summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-10-01 16:37:15 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-10-01 16:37:15 +0800
commitaed875deb2bd9ea306ad9ee64f892ddc4385b306 (patch)
tree9832a652ab54ef99ea90d1a05b64fc479fec9a7b
parent35b30d61519926aaf2114ef750cd774a1a3c7985 (diff)
downloadmrust-aed875deb2bd9ea306ad9ee64f892ddc4385b306.tar.gz
Typecheck Expressions - Don't pick a bound impl when type is Unbound UFCS
-rw-r--r--src/hir_typeck/helpers.cpp2
1 files changed, 2 insertions, 0 deletions
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<Item=&u8>` implies `<T as IntoIterator>::IntoIter : Iterator<Item=&u8>`