diff options
| author | Roxane <roxane.fruytier@hotmail.com> | 2021-07-28 12:27:57 -0400 |
|---|---|---|
| committer | Roxane <roxane.fruytier@hotmail.com> | 2021-07-28 12:27:57 -0400 |
| commit | d380ed13043d52139b3c766a07edb93b891e2be6 (patch) | |
| tree | e2b4d7ca88ecf5052745ccbbcc61c715cd684607 | |
| parent | 9829efb892f7c249f2c889722a098e6a9b34f3fb (diff) | |
| download | rust-d380ed13043d52139b3c766a07edb93b891e2be6.tar.gz rust-d380ed13043d52139b3c766a07edb93b891e2be6.zip | |
fix nit
| -rw-r--r-- | compiler/rustc_typeck/src/expr_use_visitor.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/closures/2229_closure_analysis/issue-87426.rs | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_typeck/src/expr_use_visitor.rs b/compiler/rustc_typeck/src/expr_use_visitor.rs index 201804f9fc4..1d7852d964c 100644 --- a/compiler/rustc_typeck/src/expr_use_visitor.rs +++ b/compiler/rustc_typeck/src/expr_use_visitor.rs @@ -272,9 +272,15 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> { // 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 } } })); diff --git a/src/test/ui/closures/2229_closure_analysis/issue-87426.rs b/src/test/ui/closures/2229_closure_analysis/issue-87426.rs index 4a6eb5154c1..74506979a28 100644 --- a/src/test/ui/closures/2229_closure_analysis/issue-87426.rs +++ b/src/test/ui/closures/2229_closure_analysis/issue-87426.rs @@ -11,4 +11,4 @@ pub fn foo() { fn main() { foo(); -} \ No newline at end of file +} |
