diff options
author | Florian Diebold <[email protected]> | 2020-02-07 14:13:15 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-02-07 17:28:10 +0000 |
commit | dded90a748737c3661aad043524f2248e324c867 (patch) | |
tree | f871cdf435b0c4d5cafa9f4c3f5c725e823e8088 /crates/ra_hir_ty/src/infer.rs | |
parent | 6787f124b5557120cd1e4557cbdb59aa7f215be6 (diff) |
Formatting
Diffstat (limited to 'crates/ra_hir_ty/src/infer.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index dec6bd84c..a9d958c8b 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs | |||
@@ -278,7 +278,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
278 | impl_trait_mode: ImplTraitLoweringMode, | 278 | impl_trait_mode: ImplTraitLoweringMode, |
279 | ) -> Ty { | 279 | ) -> Ty { |
280 | // FIXME use right resolver for block | 280 | // FIXME use right resolver for block |
281 | let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver).with_impl_trait_mode(impl_trait_mode); | 281 | let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver) |
282 | .with_impl_trait_mode(impl_trait_mode); | ||
282 | let ty = Ty::from_hir(&ctx, type_ref); | 283 | let ty = Ty::from_hir(&ctx, type_ref); |
283 | let ty = self.insert_type_vars(ty); | 284 | let ty = self.insert_type_vars(ty); |
284 | self.normalize_associated_types_in(ty) | 285 | self.normalize_associated_types_in(ty) |
@@ -455,8 +456,10 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
455 | 456 | ||
456 | fn collect_fn(&mut self, data: &FunctionData) { | 457 | fn collect_fn(&mut self, data: &FunctionData) { |
457 | let body = Arc::clone(&self.body); // avoid borrow checker problem | 458 | let body = Arc::clone(&self.body); // avoid borrow checker problem |
458 | let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver).with_impl_trait_mode(ImplTraitLoweringMode::Param); | 459 | let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver) |
459 | let param_tys = data.params.iter().map(|type_ref| Ty::from_hir(&ctx, type_ref)).collect::<Vec<_>>(); | 460 | .with_impl_trait_mode(ImplTraitLoweringMode::Param); |
461 | let param_tys = | ||
462 | data.params.iter().map(|type_ref| Ty::from_hir(&ctx, type_ref)).collect::<Vec<_>>(); | ||
460 | for (ty, pat) in param_tys.into_iter().zip(body.params.iter()) { | 463 | for (ty, pat) in param_tys.into_iter().zip(body.params.iter()) { |
461 | let ty = self.insert_type_vars(ty); | 464 | let ty = self.insert_type_vars(ty); |
462 | let ty = self.normalize_associated_types_in(ty); | 465 | let ty = self.normalize_associated_types_in(ty); |