]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/expr_use_visitor.rs
Rollup merge of #87727 - SkiFire13:fix-87718, r=jackh726
[rust.git] / compiler / rustc_typeck / src / expr_use_visitor.rs
index 201804f9fc40b6f53f2339a2a4fb7320cf1e96c5..1d7852d964c1dd428108c9934c0ffbe40e0886ce 100644 (file)
@@ -272,9 +272,15 @@ pub fn walk_expr(&mut self, expr: &hir::Expr<'_>) {
                                 // to borrow discr.
                                 needs_to_be_read = true;
                             }
-                            _ => {
+                            PatKind::Or(_)
+                            | PatKind::Box(_)
+                            | PatKind::Slice(..)
+                            | PatKind::Ref(..)
+                            | PatKind::Wild => {
                                 // If the PatKind is Or, Box, Slice or Ref, the decision is made later
                                 // as these patterns contains subpatterns
+                                // If the PatKind is Wild, the decision is made based on the other patterns being
+                                // examined
                             }
                         }
                     }));