diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-10-01 16:37:15 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-10-01 16:37:15 +0800 |
commit | aed875deb2bd9ea306ad9ee64f892ddc4385b306 (patch) | |
tree | 9832a652ab54ef99ea90d1a05b64fc479fec9a7b | |
parent | 35b30d61519926aaf2114ef750cd774a1a3c7985 (diff) | |
download | mrust-aed875deb2bd9ea306ad9ee64f892ddc4385b306.tar.gz |
Typecheck Expressions - Don't pick a bound impl when type is Unbound UFCS
-rw-r--r-- | src/hir_typeck/helpers.cpp | 2 |
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>` |