From 61c09edb4af6973e9ac5a84c954470c1fd4c9a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 8 Apr 2019 16:47:28 +0300 Subject: [PATCH] Avoid two-phase borrow conflict --- crates/ra_hir/src/ty/infer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 9ace6b13a01b..28947be5128c 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -489,8 +489,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { Some(ty) } Resolution::LocalBinding(pat) => { - let ty = self.type_of_pat.get(pat)?; - let ty = self.resolve_ty_as_possible(&mut vec![], ty.clone()); + let ty = self.type_of_pat.get(pat)?.clone(); + let ty = self.resolve_ty_as_possible(&mut vec![], ty); Some(ty) } Resolution::GenericParam(..) => {