about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/middle/typeck/check/regionck.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs
index 2eb646a0b9b..9cfa0187ab6 100644
--- a/src/librustc/middle/typeck/check/regionck.rs
+++ b/src/librustc/middle/typeck/check/regionck.rs
@@ -460,6 +460,10 @@ fn constrain_call(rcx: @mut Rcx,
     debug!("constrain_call(call_expr=%s, implicitly_ref_args=%?)",
            call_expr.repr(tcx), implicitly_ref_args);
     let callee_ty = rcx.resolve_node_type(callee_id);
+    if ty::type_is_error(callee_ty) {
+        // Bail, as function type is unknown
+        return;
+    }
     let fn_sig = ty::ty_fn_sig(callee_ty);
 
     // `callee_region` is the scope representing the time in which the