@@ -317,7 +317,7 @@ fn pat_is_catchall(pat: &Pat) -> bool {
317
317
}
318
318
}
319
319
320
- // Check for unreachable patterns
320
+ /// Check for unreachable patterns.
321
321
fn check_arms < ' p , ' tcx > (
322
322
cx : & mut MatchCheckCtxt < ' p , ' tcx > ,
323
323
arms : & [ ( & ' p super :: Pat < ' tcx > , & hir:: Pat , bool ) ] ,
@@ -574,7 +574,7 @@ fn maybe_point_at_variant(ty: Ty<'_>, patterns: &[super::Pat<'_>]) -> Vec<Span>
574
574
covered
575
575
}
576
576
577
- // Check the legality of legality of by-move bindings.
577
+ /// Check the legality of legality of by-move bindings.
578
578
fn check_legality_of_move_bindings ( cx : & mut MatchVisitor < ' _ , ' _ > , has_guard : bool , pat : & Pat ) {
579
579
let sess = cx. tcx . sess ;
580
580
let tables = cx. tables ;
@@ -630,6 +630,14 @@ fn check_legality_of_move_bindings(cx: &mut MatchVisitor<'_, '_>, has_guard: boo
630
630
}
631
631
}
632
632
633
+ /// Check that there are no borrow conflicts in `binding @ subpat` patterns.
634
+ ///
635
+ /// For example, this would reject:
636
+ /// - `ref x @ Some(ref mut y)`,
637
+ /// - `ref mut x @ Some(ref y)`
638
+ /// - `ref mut x @ Some(ref mut y)`.
639
+ ///
640
+ /// This analysis is *not* subsumed by NLL.
633
641
fn check_borrow_conflicts_in_at_patterns ( cx : & MatchVisitor < ' _ , ' _ > , pat : & Pat ) {
634
642
let tab = cx. tables ;
635
643
let sess = cx. tcx . sess ;
0 commit comments