diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-10 15:53:03 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-10 15:53:03 +0800 |
commit | 5810c5abb9db325a1fc9de1ac11a91739a7f6cc7 (patch) | |
tree | ac5990778aa9cdfdbf3f9573e609fb7204b7e488 /src | |
parent | 985b825d1096ed500fc54233f7a65c3eb4055932 (diff) | |
download | mrust-5810c5abb9db325a1fc9de1ac11a91739a7f6cc7.tar.gz |
HIR Typecheck Static - Handle still-specialisable impls
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/static.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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); } |