Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer.rs')
-rw-r--r--crates/hir-ty/src/infer.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs
index 4aeb5ec71c..3a0f9f8048 100644
--- a/crates/hir-ty/src/infer.rs
+++ b/crates/hir-ty/src/infer.rs
@@ -1110,8 +1110,8 @@ impl InferenceResult {
self.expr_adjustments.get(&id).map(|it| &**it)
}
- pub fn binding_mode(&self, id: PatId) -> BindingMode {
- self.binding_modes[id]
+ pub fn binding_mode(&self, id: PatId) -> Option<BindingMode> {
+ self.binding_modes.get(id).copied()
}
// This method is consumed by external tools to run rust-analyzer as a library. Don't remove, please.