diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-10 11:03:51 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-10 11:03:51 +0800 |
commit | 5c36ead17fd077b31ab7a4564f6105c0711d1956 (patch) | |
tree | 069fa603c1ddafa90be9c7b7212b31842d7c132d /src | |
parent | df04781dac4d93d11c016edd6459397a4dcaa62e (diff) | |
download | mrust-5c36ead17fd077b31ab7a4564f6105c0711d1956.tar.gz |
HIR Typecheck Static - Error if an impl couldn't be found in EAT
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/static.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/hir_typeck/static.cpp b/src/hir_typeck/static.cpp index 9287440f..050ca392 100644 --- a/src/hir_typeck/static.cpp +++ b/src/hir_typeck/static.cpp @@ -739,23 +739,8 @@ void StaticTraitResolve::expand_associated_types__UfcsKnown(const Span& sp, ::HI this->expand_associated_types(sp, input); return; } - /* - if( best_impl.is_valid() ) { - auto nt = best_impl.get_type( e2.item.c_str() ); - DEBUG("Converted UfcsKnown (best specialisation) - " << e.path << " = " << nt); - input = mv$(nt); - - this->expand_associated_types(sp, input); - return; - } - */ - // If the type is a generic or an opaque associated, we can't know. - // - If the trait contains any of the above, it's unknowable - // - Otherwise, it's an error - e.binding = ::HIR::TypeRef::TypePathBinding::make_Opaque({}); - this->replace_equalities(input); - DEBUG("Couldn't resolve associated type for " << input << " (and won't ever be able to, assuming opaque)"); + ERROR(sp, E0000, "Cannot find an implementation of " << trait_path << " for " << *e2.type); } void StaticTraitResolve::replace_equalities(::HIR::TypeRef& input) const |