From 5810c5abb9db325a1fc9de1ac11a91739a7f6cc7 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 10 Oct 2016 15:53:03 +0800 Subject: HIR Typecheck Static - Handle still-specialisable impls --- src/hir_typeck/static.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/hir_typeck/static.cpp b/src/hir_typeck/static.cpp index 050ca392..a9ccad78 100644 --- a/src/hir_typeck/static.cpp +++ b/src/hir_typeck/static.cpp @@ -739,6 +739,12 @@ void StaticTraitResolve::expand_associated_types__UfcsKnown(const Span& sp, ::HI this->expand_associated_types(sp, input); return; } + if( best_impl.is_valid() ) { + e.binding = ::HIR::TypeRef::TypePathBinding::make_Opaque({}); + this->replace_equalities(input); + DEBUG("- Couldn't find a non-specialised impl of " << trait_path << " for " << *e2.type << " - treating as opaque"); + return ; + } ERROR(sp, E0000, "Cannot find an implementation of " << trait_path << " for " << *e2.type); } -- cgit v1.2.3