summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hir_typeck/expr_cs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index 301c5d54..a0634022 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -3835,6 +3835,12 @@ void Context::handle_pattern(const Span& sp, ::HIR::Pattern& pat, const ::HIR::T
}
}
+ // For `_` patterns, there's nothing to match, so they just succeed with no derefs
+ if( pattern.m_data.is_Any() )
+ {
+ return true;
+ }
+
// If the type is a borrow, then count derefs required for the borrow
// - If the first non-borrow inner is an ivar, return false
unsigned n_deref = 0;