aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/pat.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-26 16:36:14 +0100
committerGitHub <[email protected]>2021-05-26 16:36:14 +0100
commitf3aaae65553550cc9b7101a844ecbc3d426a1bef (patch)
tree87a5fcbaa5c3a8851425b15689f95328213c6cd1 /crates/hir_ty/src/infer/pat.rs
parent5a1fd05760260be9a91f6fad2fd6463edffbcb13 (diff)
parent8206939fed0e2307455d46620ee114f74ab35d7f (diff)
Merge #9007
9007: Internal: `clippy::redundant_clone` fixes r=lnicola a=lnicola bors r+ Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer/pat.rs')
-rw-r--r--crates/hir_ty/src/infer/pat.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs
index 9c8e3b6ae..83e0a7a9e 100644
--- a/crates/hir_ty/src/infer/pat.rs
+++ b/crates/hir_ty/src/infer/pat.rs
@@ -196,7 +196,7 @@ impl<'a> InferenceContext<'a> {
196 let inner_ty = if let Some(subpat) = subpat { 196 let inner_ty = if let Some(subpat) = subpat {
197 self.infer_pat(*subpat, &expected, default_bm) 197 self.infer_pat(*subpat, &expected, default_bm)
198 } else { 198 } else {
199 expected.clone() 199 expected
200 }; 200 };
201 let inner_ty = self.insert_type_vars_shallow(inner_ty); 201 let inner_ty = self.insert_type_vars_shallow(inner_ty);
202 202
@@ -266,10 +266,9 @@ impl<'a> InferenceContext<'a> {
266 // use a new type variable if we got error type here 266 // use a new type variable if we got error type here
267 let ty = self.insert_type_vars_shallow(ty); 267 let ty = self.insert_type_vars_shallow(ty);
268 if !self.unify(&ty, &expected) { 268 if !self.unify(&ty, &expected) {
269 self.result.type_mismatches.insert( 269 self.result
270 pat.into(), 270 .type_mismatches
271 TypeMismatch { expected: expected.clone(), actual: ty.clone() }, 271 .insert(pat.into(), TypeMismatch { expected: expected, actual: ty.clone() });
272 );
273 } 272 }
274 self.write_pat_ty(pat, ty.clone()); 273 self.write_pat_ty(pat, ty.clone());
275 ty 274 ty