diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-11-19 12:53:54 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-11-19 12:53:54 +0800 |
commit | 183153147d29e08a01e2930bbccf894917bc2a14 (patch) | |
tree | a28f50409f6a12a6938e525223678560a743fedb | |
parent | 178fcd4bbc686a0f4821cc5afd56161f064d0e30 (diff) | |
download | mrust-183153147d29e08a01e2930bbccf894917bc2a14.tar.gz |
Typecheck Expressions - Incremental change to auto trait handling
-rw-r--r-- | src/hir_typeck/helpers.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index f74ef4f0..1a9382b6 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -2621,6 +2621,10 @@ bool TraitResolution::find_trait_impls_crate(const Span& sp, BUG(sp, "UfcsUnknown in typeck - " << type); ), (UfcsKnown, + // If unbound, use Fuzzy + if(e.binding.is_Unbound()) + return ::HIR::Compare::Fuzzy; + // Otherwise, it's opaque. Check the bounds on the trait. TODO(sp, "Check trait bounds for bound on " << type); ), (UfcsInherent, @@ -2629,6 +2633,9 @@ bool TraitResolution::find_trait_impls_crate(const Span& sp, ) return res; ) + else TU_IFLET( ::HIR::TypeRef::Data, type.m_data, Generic, e, + TODO(sp, "Check trait bounds on " << type); + ) else TU_IFLET( ::HIR::TypeRef::Data, type.m_data, Tuple, e, ::HIR::Compare res = ::HIR::Compare::Equal; for(const auto& sty : e) |