From ca5ed2307c6dd8396f58460652c77a6a63704e0b Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 12 Jun 2019 20:51:29 +0200 Subject: Implement * operation using Deref trait --- crates/ra_hir/src/ty/infer.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index fdb444de2..1ee40c70a 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -1126,10 +1126,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { let inner_ty = self.infer_expr(*expr, &Expectation::none()); match op { UnaryOp::Deref => { - if let Some(derefed_ty) = inner_ty.builtin_deref() { - derefed_ty + let canonicalized = self.canonicalizer().canonicalize_ty(inner_ty); + if let Some(derefed_ty) = + autoderef::deref(self.db, &self.resolver, &canonicalized.value) + { + canonicalized.decanonicalize_ty(derefed_ty.value) } else { - // FIXME Deref::deref Ty::Unknown } } -- cgit v1.2.3