Skip to content

Commit d380ed1

Browse files
committed
fix nit
1 parent 9829efb commit d380ed1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

compiler/rustc_typeck/src/expr_use_visitor.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,15 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
272272
// to borrow discr.
273273
needs_to_be_read = true;
274274
}
275-
_ => {
275+
PatKind::Or(_)
276+
| PatKind::Box(_)
277+
| PatKind::Slice(..)
278+
| PatKind::Ref(..)
279+
| PatKind::Wild => {
276280
// If the PatKind is Or, Box, Slice or Ref, the decision is made later
277281
// as these patterns contains subpatterns
282+
// If the PatKind is Wild, the decision is made based on the other patterns being
283+
// examined
278284
}
279285
}
280286
}));

src/test/ui/closures/2229_closure_analysis/issue-87426.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ pub fn foo() {
1111

1212
fn main() {
1313
foo();
14-
}
14+
}

0 commit comments

Comments
 (0)