summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-11-21 13:02:13 +0800
committerJohn Hodge <tpg@mutabah.net>2016-11-21 13:02:13 +0800
commitad71f34c5362adb0f2054a60c8da8222272b1538 (patch)
tree8094ec76abb6ea3d561a365b8b73a9a9ca41ec30
parent13ee02a064c47f506702255e9c08da704a37096f (diff)
downloadmrust-ad71f34c5362adb0f2054a60c8da8222272b1538.tar.gz
HIR Typecheck Static - Auto trait search
-rw-r--r--src/hir_typeck/static.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/hir_typeck/static.cpp b/src/hir_typeck/static.cpp
index 4a0e176d..746de82d 100644
--- a/src/hir_typeck/static.cpp
+++ b/src/hir_typeck/static.cpp
@@ -271,14 +271,21 @@ bool StaticTraitResolve::find_impl(
if(ret)
return true;
- // Search the crate for impls
- ret = m_crate.find_trait_impls(trait_path, type, cb_ident, [&](const auto& impl) {
- return this->find_impl__check_crate(sp, trait_path, trait_params, type, found_cb, impl);
- });
- if(ret)
- return true;
-
- return false;
+ if( m_crate.get_trait_by_path(sp, trait_path).m_is_marker )
+ {
+ TODO(sp, "Search for auto trait impls - " << trait_path << " for " << type);
+ }
+ else
+ {
+ // Search the crate for impls
+ ret = m_crate.find_trait_impls(trait_path, type, cb_ident, [&](const auto& impl) {
+ return this->find_impl__check_crate(sp, trait_path, trait_params, type, found_cb, impl);
+ });
+ if(ret)
+ return true;
+
+ return false;
+ }
}
bool StaticTraitResolve::find_impl__check_bound(