diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2024-02-06 03:37:03 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2024-03-11 04:38:57 +0100 |
| commit | d339bdaa071ae50e20b9dbf1084df30a92c9576f (patch) | |
| tree | 47bb7ee23b20a1dd15b3011950a975a0b91c7490 /compiler/rustc_mir_build/src | |
| parent | 6ae9fa31f0588fd456cb0937c452a27006ed2810 (diff) | |
| download | rust-d339bdaa071ae50e20b9dbf1084df30a92c9576f.tar.gz rust-d339bdaa071ae50e20b9dbf1084df30a92c9576f.zip | |
`DeconstructedPat.data` is always present now
Diffstat (limited to 'compiler/rustc_mir_build/src')
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/check_match.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index 1fe571962ed..f395bb44f57 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -420,9 +420,9 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> { { let mut redundant_subpats = redundant_subpats.clone(); // Emit lints in the order in which they occur in the file. - redundant_subpats.sort_unstable_by_key(|pat| pat.data().unwrap().span); + redundant_subpats.sort_unstable_by_key(|pat| pat.data().span); for pat in redundant_subpats { - report_unreachable_pattern(cx, arm.arm_data, pat.data().unwrap().span, None) + report_unreachable_pattern(cx, arm.arm_data, pat.data().span, None) } } } @@ -905,10 +905,10 @@ fn report_arm_reachability<'p, 'tcx>( let mut catchall = None; for (arm, is_useful) in report.arm_usefulness.iter() { if matches!(is_useful, Usefulness::Redundant) { - report_unreachable_pattern(cx, arm.arm_data, arm.pat.data().unwrap().span, catchall) + report_unreachable_pattern(cx, arm.arm_data, arm.pat.data().span, catchall) } if !arm.has_guard && catchall.is_none() && pat_is_catchall(arm.pat) { - catchall = Some(arm.pat.data().unwrap().span); + catchall = Some(arm.pat.data().span); } } } |
