From c098a3fda52ef0b02188abfa91adcd67e82c0c02 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 9 Feb 2019 22:03:01 +0100 Subject: Add comment and mark --- crates/ra_hir/src/ty.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/ty.rs') diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 5d5bde305..7203a8a10 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -1003,8 +1003,13 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { /// otherwise, return ty. fn resolve_ty_shallow<'b>(&mut self, ty: &'b Ty) -> Cow<'b, Ty> { let mut ty = Cow::Borrowed(ty); - for _ in 0..3 { - // the type variable could resolve to a int/float variable + // The type variable could resolve to a int/float variable. Hence try + // resolving up to three times; each type of variable shouldn't occur + // more than once + for i in 0..3 { + if i > 0 { + tested_by!(type_var_resolves_to_int_var); + } match &*ty { Ty::Infer(tv) => { let inner = tv.to_inner(); @@ -1019,6 +1024,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { _ => return ty, } } + log::error!("Inference variable still not resolved: {:?}", ty); ty } -- cgit v1.2.3