From ad71f34c5362adb0f2054a60c8da8222272b1538 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 21 Nov 2016 13:02:13 +0800 Subject: HIR Typecheck Static - Auto trait search --- src/hir_typeck/static.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src') 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( -- cgit v1.2.3