aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-06-12 19:51:29 +0100
committerFlorian Diebold <[email protected]>2019-06-15 17:21:23 +0100
commitca5ed2307c6dd8396f58460652c77a6a63704e0b (patch)
treea88c2450cd61c22b7472aa4021a797edb08861ad
parent9c5e7dd849eff7bd6f20aa353feef083d089ff58 (diff)
Implement * operation using Deref trait
-rw-r--r--crates/ra_hir/src/ty/infer.rs8
1 files changed, 5 insertions, 3 deletions
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> {
1126 let inner_ty = self.infer_expr(*expr, &Expectation::none()); 1126 let inner_ty = self.infer_expr(*expr, &Expectation::none());
1127 match op { 1127 match op {
1128 UnaryOp::Deref => { 1128 UnaryOp::Deref => {
1129 if let Some(derefed_ty) = inner_ty.builtin_deref() { 1129 let canonicalized = self.canonicalizer().canonicalize_ty(inner_ty);
1130 derefed_ty 1130 if let Some(derefed_ty) =
1131 autoderef::deref(self.db, &self.resolver, &canonicalized.value)
1132 {
1133 canonicalized.decanonicalize_ty(derefed_ty.value)
1131 } else { 1134 } else {
1132 // FIXME Deref::deref
1133 Ty::Unknown 1135 Ty::Unknown
1134 } 1136 }
1135 } 1137 }