Skip to content

Commit 307a278

Browse files
committed
Identify subpatterns by the path to them instead of spans
1 parent 0162d60 commit 307a278

File tree

6 files changed

+252
-132
lines changed

6 files changed

+252
-132
lines changed

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ fn report_arm_reachability<'p, 'tcx>(
434434
Reachable(unreachables) if unreachables.is_empty() => {}
435435
// The arm is reachable, but contains unreachable subpatterns (from or-patterns).
436436
Reachable(unreachables) => {
437-
let mut unreachables: Vec<_> = unreachables.iter().collect();
437+
let mut unreachables = unreachables.clone();
438438
// Emit lints in the order in which they occur in the file.
439439
unreachables.sort_unstable();
440440
for span in unreachables {

0 commit comments

Comments
 (0)