summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-11-24 12:45:40 +0800
committerJohn Hodge <tpg@mutabah.net>2016-11-24 12:45:40 +0800
commitb30e0cb052522a03b827e636c1d76219690e3d81 (patch)
tree55997aa26ff59795574668a65c7d9f659d640ac4
parentdb711beb114c6b494aa5ce60358f7323073fa90d (diff)
downloadmrust-b30e0cb052522a03b827e636c1d76219690e3d81.tar.gz
HIR Typecheck Expr - Defer unsize to TraitObject if there are magic parameters
-rw-r--r--src/hir_typeck/expr_cs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index 1e1997b1..962bf42c 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -4264,6 +4264,11 @@ namespace {
return false;
}
+ if( best_impl.has_magic_params() ) {
+ DEBUG("Defer as there were magic parameters");
+ return false;
+ }
+
// TODO: Get a better way of equating these that doesn't require getting copies of the impl's types
context.equate_types(sp, ty_src, best_impl.get_impl_type());
auto args = best_impl.get_trait_params();