From a5516971342ed8fa9ddfb0a05a73c27c180125d1 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 17 Jul 2015 08:21:24 -0400 Subject: [PATCH] Don't be so eager to call unresolved inference variables an error. MC is being used now before the final regionck stage and in some cases SOME amount of unresolved inference is OK. In fact, we could probably just allow inference variables as well with only minimal pain. --- src/librustc/middle/infer/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs index e6cea4d1b6a..48042c152b8 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/middle/infer/mod.rs @@ -1162,7 +1162,15 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { /// these unconstrained type variables. fn resolve_type_vars_or_error(&self, t: &Ty<'tcx>) -> mc::McResult> { let ty = self.resolve_type_vars_if_possible(t); - if ty.has_infer_types() || ty.references_error() { Err(()) } else { Ok(ty) } + if ty.references_error() { + debug!("resolve_type_vars_or_error: error from {:?}", ty); + Err(()) + } else if ty.is_ty_var() { + debug!("resolve_type_vars_or_error: error from {:?}", ty); + Err(()) + } else { + Ok(ty) + } } pub fn fully_resolve>(&self, value: &T) -> FixupResult {