diff options
Diffstat (limited to 'crates/ra_hir/src/ty/autoderef.rs')
-rw-r--r-- | crates/ra_hir/src/ty/autoderef.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index 90c1ae630..214aa7d03 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,7 +62,9 @@ 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 in_env = super::traits::InEnvironment { value: projection, environment: env }; |
66 | |||
67 | let canonical = super::Canonical { num_vars: 1 + ty.num_vars, value: in_env }; | ||
64 | 68 | ||
65 | let solution = db.normalize(krate, canonical)?; | 69 | let solution = db.normalize(krate, canonical)?; |
66 | 70 | ||