diff options
Diffstat (limited to 'crates/ra_hir/src/ty/autoderef.rs')
-rw-r--r-- | crates/ra_hir/src/ty/autoderef.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index 90c1ae630..c26513871 100644 --- a/crates/ra_hir/src/ty/autoderef.rs +++ b/crates/ra_hir/src/ty/autoderef.rs | |||
@@ -52,6 +52,8 @@ fn deref_by_trait( | |||
52 | 52 | ||
53 | // FIXME make the Canonical handling nicer | 53 | // FIXME make the Canonical handling nicer |
54 | 54 | ||
55 | let env = super::lower::trait_env(db, resolver); | ||
56 | |||
55 | let projection = super::traits::ProjectionPredicate { | 57 | let projection = super::traits::ProjectionPredicate { |
56 | ty: Ty::Bound(0), | 58 | ty: Ty::Bound(0), |
57 | projection_ty: super::ProjectionTy { | 59 | projection_ty: super::ProjectionTy { |
@@ -60,9 +62,13 @@ fn deref_by_trait( | |||
60 | }, | 62 | }, |
61 | }; | 63 | }; |
62 | 64 | ||
63 | let canonical = super::Canonical { num_vars: 1 + ty.num_vars, value: projection }; | 65 | let obligation = super::Obligation::Projection(projection); |
66 | |||
67 | let in_env = super::traits::InEnvironment { value: obligation, environment: env }; | ||
68 | |||
69 | let canonical = super::Canonical { num_vars: 1 + ty.num_vars, value: in_env }; | ||
64 | 70 | ||
65 | let solution = db.normalize(krate, canonical)?; | 71 | let solution = db.solve(krate, canonical)?; |
66 | 72 | ||
67 | match &solution { | 73 | match &solution { |
68 | Solution::Unique(vars) => { | 74 | Solution::Unique(vars) => { |