From d0ff2392e7d015174d300a2818f613bc0257679c Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 30 Dec 2016 20:41:46 +0800 Subject: HIR Typecheck Static - Expand associated when doing auto trait searches --- src/hir_typeck/static.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hir_typeck/static.cpp b/src/hir_typeck/static.cpp index eba58331..32fb817e 100644 --- a/src/hir_typeck/static.cpp +++ b/src/hir_typeck/static.cpp @@ -656,7 +656,9 @@ bool StaticTraitResolve::find_impl__check_crate( // HELPER: Get a possibily monomorphised version of the input type (stored in `tmp` if needed) auto monomorph_get = [&](const auto& ty)->const auto& { if( monomorphise_type_needed(ty) ) { - return (tmp = monomorphise_type_with(sp, ty, monomorph_cb)); + tmp = monomorphise_type_with(sp, ty, monomorph_cb); + this->expand_associated_types(sp, tmp); + return tmp; } else { return ty; @@ -746,7 +748,7 @@ bool StaticTraitResolve::find_impl__check_crate( BUG(sp, "UfcsUnknown in typeck - " << type); ), (UfcsKnown, - TODO(sp, "Check trait bounds for bound on " << type); + TODO(sp, "Check trait bounds for bound on UfcsKnown " << type); ), (UfcsInherent, TODO(sp, "Auto trait lookup on UFCS Inherent type"); -- cgit v1.2.3