diff options
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index 17849d552..4e2a432ed 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -90,12 +90,12 @@ impl<'a> InferenceContext<'a> { | |||
90 | let substs = | 90 | let substs = |
91 | Substitution::build_for_generics(&generic_params).push(ty.clone()).push(arg_ty).build(); | 91 | Substitution::build_for_generics(&generic_params).push(ty.clone()).push(arg_ty).build(); |
92 | 92 | ||
93 | let trait_env = Arc::clone(&self.trait_env); | 93 | let trait_env = self.trait_env.env.clone(); |
94 | let implements_fn_trait: DomainGoal = | 94 | let implements_fn_trait: DomainGoal = |
95 | TraitRef { trait_id: to_chalk_trait_id(fn_once_trait), substitution: substs.clone() } | 95 | TraitRef { trait_id: to_chalk_trait_id(fn_once_trait), substitution: substs.clone() } |
96 | .cast(&Interner); | 96 | .cast(&Interner); |
97 | let goal = self.canonicalizer().canonicalize_obligation(InEnvironment { | 97 | let goal = self.canonicalizer().canonicalize_obligation(InEnvironment { |
98 | value: implements_fn_trait.clone(), | 98 | goal: implements_fn_trait.clone(), |
99 | environment: trait_env, | 99 | environment: trait_env, |
100 | }); | 100 | }); |
101 | if self.db.trait_solve(krate, goal.value).is_some() { | 101 | if self.db.trait_solve(krate, goal.value).is_some() { |
@@ -299,8 +299,8 @@ impl<'a> InferenceContext<'a> { | |||
299 | self.db, | 299 | self.db, |
300 | self.resolver.krate(), | 300 | self.resolver.krate(), |
301 | InEnvironment { | 301 | InEnvironment { |
302 | value: canonicalized.value.clone(), | 302 | goal: canonicalized.value.clone(), |
303 | environment: self.trait_env.clone(), | 303 | environment: self.trait_env.env.clone(), |
304 | }, | 304 | }, |
305 | ); | 305 | ); |
306 | let (param_tys, ret_ty): (Vec<Ty>, Ty) = derefs | 306 | let (param_tys, ret_ty): (Vec<Ty>, Ty) = derefs |
@@ -438,8 +438,8 @@ impl<'a> InferenceContext<'a> { | |||
438 | self.db, | 438 | self.db, |
439 | self.resolver.krate(), | 439 | self.resolver.krate(), |
440 | InEnvironment { | 440 | InEnvironment { |
441 | value: canonicalized.value.clone(), | 441 | goal: canonicalized.value.clone(), |
442 | environment: self.trait_env.clone(), | 442 | environment: self.trait_env.env.clone(), |
443 | }, | 443 | }, |
444 | ) | 444 | ) |
445 | .find_map(|derefed_ty| { | 445 | .find_map(|derefed_ty| { |
@@ -538,8 +538,8 @@ impl<'a> InferenceContext<'a> { | |||
538 | self.db, | 538 | self.db, |
539 | krate, | 539 | krate, |
540 | InEnvironment { | 540 | InEnvironment { |
541 | value: &canonicalized.value, | 541 | goal: &canonicalized.value, |
542 | environment: self.trait_env.clone(), | 542 | environment: self.trait_env.env.clone(), |
543 | }, | 543 | }, |
544 | ) { | 544 | ) { |
545 | Some(derefed_ty) => { | 545 | Some(derefed_ty) => { |