summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hir_typeck/expr_cs.cpp4
-rw-r--r--src/hir_typeck/helpers.cpp3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index 1241f7b6..1f6dccdc 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -2647,6 +2647,10 @@ namespace {
DEBUG("Hit ivar, returning early");
return ;
}
+ if(ty.m_data.is_Path() && ty.m_data.as_Path().binding.is_Unbound()) {
+ DEBUG("Hit unbound path, returning early");
+ return ;
+ }
if( this->context.m_resolve.find_field(node.span(), ty, field_name, out_type) ) {
this->context.equate_types(node.span(), node.m_res_type, out_type);
break;
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp
index b7c995e4..6948e60c 100644
--- a/src/hir_typeck/helpers.cpp
+++ b/src/hir_typeck/helpers.cpp
@@ -3294,6 +3294,9 @@ unsigned int TraitResolution::autoderef_find_field(const Span& sp, const ::HIR::
if( ty.m_data.is_Infer() ) {
return ~0u;
}
+ if(ty.m_data.is_Path() && ty.m_data.as_Path().binding.is_Unbound()) {
+ return ~0u;
+ }
if( this->find_field(sp, ty, field_name, field_type) ) {
return deref_count;