Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/diagnostics/match_check.rs')
| -rw-r--r-- | crates/hir-ty/src/diagnostics/match_check.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir-ty/src/diagnostics/match_check.rs b/crates/hir-ty/src/diagnostics/match_check.rs index 8b0f051b46..859a37804a 100644 --- a/crates/hir-ty/src/diagnostics/match_check.rs +++ b/crates/hir-ty/src/diagnostics/match_check.rs @@ -146,8 +146,9 @@ impl<'a> PatCtxt<'a> { PatKind::Leaf { subpatterns } } - hir_def::expr::Pat::Bind { ref name, subpat, .. } => { + hir_def::expr::Pat::Bind { id, subpat, .. } => { let bm = self.infer.pat_binding_modes[&pat]; + let name = &self.body.bindings[id].name; match (bm, ty.kind(Interner)) { (BindingMode::Ref(_), TyKind::Ref(.., rty)) => ty = rty, (BindingMode::Ref(_), _) => { |