diff options
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index 4e77f22fd..a72424dc7 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -18,6 +18,7 @@ use crate::{ | |||
18 | lower::lower_to_chalk_mutability, | 18 | lower::lower_to_chalk_mutability, |
19 | method_resolution, op, | 19 | method_resolution, op, |
20 | primitive::{self, UintTy}, | 20 | primitive::{self, UintTy}, |
21 | to_assoc_type_id, | ||
21 | traits::{FnTrait, InEnvironment}, | 22 | traits::{FnTrait, InEnvironment}, |
22 | utils::{generics, variant_data, Generics}, | 23 | utils::{generics, variant_data, Generics}, |
23 | AdtId, Binders, CallableDefId, FnPointer, FnSig, Interner, Obligation, OpaqueTyId, Rawness, | 24 | AdtId, Binders, CallableDefId, FnPointer, FnSig, Interner, Obligation, OpaqueTyId, Rawness, |
@@ -97,8 +98,10 @@ impl<'a> InferenceContext<'a> { | |||
97 | }); | 98 | }); |
98 | if self.db.trait_solve(krate, goal.value).is_some() { | 99 | if self.db.trait_solve(krate, goal.value).is_some() { |
99 | self.obligations.push(implements_fn_trait); | 100 | self.obligations.push(implements_fn_trait); |
100 | let output_proj_ty = | 101 | let output_proj_ty = crate::ProjectionTy { |
101 | crate::ProjectionTy { associated_ty: output_assoc_type, parameters: substs }; | 102 | associated_ty: to_assoc_type_id(output_assoc_type), |
103 | parameters: substs, | ||
104 | }; | ||
102 | let return_ty = self.normalize_projection_ty(output_proj_ty); | 105 | let return_ty = self.normalize_projection_ty(output_proj_ty); |
103 | Some((arg_tys, return_ty)) | 106 | Some((arg_tys, return_ty)) |
104 | } else { | 107 | } else { |