aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/infer
diff options
context:
space:
mode:
authorShotaro Yamada <[email protected]>2019-10-14 11:50:12 +0100
committerShotaro Yamada <[email protected]>2019-10-14 11:50:12 +0100
commit3a55b5bf01ddc581a3f00fa56db725db93a131c6 (patch)
treeb3cbc2d477141507f76f5f973daa9fb5545bd731 /crates/ra_hir/src/ty/infer
parentb462eb96b867cd38c60fb3d94ffd7688cec70f21 (diff)
make_mut_slice
Diffstat (limited to 'crates/ra_hir/src/ty/infer')
-rw-r--r--crates/ra_hir/src/ty/infer/unify.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/ra_hir/src/ty/infer/unify.rs b/crates/ra_hir/src/ty/infer/unify.rs
index 5e86ed260..014c7981f 100644
--- a/crates/ra_hir/src/ty/infer/unify.rs
+++ b/crates/ra_hir/src/ty/infer/unify.rs
@@ -6,7 +6,7 @@ use crate::ty::{
6 Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, 6 Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty,
7 TypeWalk, 7 TypeWalk,
8}; 8};
9use crate::util::make_mut_arc_slice; 9use crate::util::make_mut_slice;
10 10
11impl<'a, D: HirDatabase> InferenceContext<'a, D> { 11impl<'a, D: HirDatabase> InferenceContext<'a, D> {
12 pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D> 12 pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D>
@@ -76,11 +76,9 @@ where
76 } 76 }
77 77
78 fn do_canonicalize_trait_ref(&mut self, mut trait_ref: TraitRef) -> TraitRef { 78 fn do_canonicalize_trait_ref(&mut self, mut trait_ref: TraitRef) -> TraitRef {
79 make_mut_arc_slice(&mut trait_ref.substs.0, |tys| { 79 for ty in make_mut_slice(&mut trait_ref.substs.0) {
80 for ty in tys { 80 *ty = self.do_canonicalize_ty(ty.clone());
81 *ty = self.do_canonicalize_ty(ty.clone()); 81 }
82 }
83 });
84 trait_ref 82 trait_ref
85 } 83 }
86 84
@@ -92,11 +90,9 @@ where
92 } 90 }
93 91
94 fn do_canonicalize_projection_ty(&mut self, mut projection_ty: ProjectionTy) -> ProjectionTy { 92 fn do_canonicalize_projection_ty(&mut self, mut projection_ty: ProjectionTy) -> ProjectionTy {
95 make_mut_arc_slice(&mut projection_ty.parameters.0, |params| { 93 for ty in make_mut_slice(&mut projection_ty.parameters.0) {
96 for ty in params { 94 *ty = self.do_canonicalize_ty(ty.clone());
97 *ty = self.do_canonicalize_ty(ty.clone()); 95 }
98 }
99 });
100 projection_ty 96 projection_ty
101 } 97 }
102 98