Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/pat.rs')
| -rw-r--r-- | crates/hir-ty/src/infer/pat.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir-ty/src/infer/pat.rs b/crates/hir-ty/src/infer/pat.rs index dbce0f7cd4..c06d262f5e 100644 --- a/crates/hir-ty/src/infer/pat.rs +++ b/crates/hir-ty/src/infer/pat.rs @@ -42,7 +42,7 @@ impl<'a> InferenceContext<'a> { Some(idx) => subpats.split_at(idx), None => (subpats, &[][..]), }; - let post_idx_offset = field_tys.iter().count() - post.len(); + let post_idx_offset = field_tys.iter().count().saturating_sub(post.len()); let pre_iter = pre.iter().enumerate(); let post_iter = (post_idx_offset..).zip(post.iter()); |