Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_ty/src/diagnostics/match_check/usefulness.rs')
-rw-r--r--crates/hir_ty/src/diagnostics/match_check/usefulness.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs
index b5d238116f..bb072ae70a 100644
--- a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs
+++ b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs
@@ -295,7 +295,6 @@ pub(crate) struct MatchCheckCtx<'a> {
pub(crate) db: &'a dyn HirDatabase,
/// Lowered patterns from arms plus generated by the check.
pub(crate) pattern_arena: &'a RefCell<PatternArena>,
- pub(crate) panic_context: &'a dyn Fn() -> String,
}
impl<'a> MatchCheckCtx<'a> {
@@ -328,11 +327,6 @@ impl<'a> MatchCheckCtx<'a> {
pub(super) fn type_of(&self, pat: PatId) -> Ty {
self.pattern_arena.borrow()[pat].ty.clone()
}
-
- #[track_caller]
- pub(super) fn bug(&self, info: &str) -> ! {
- panic!("bug: {}\n{}", info, (self.panic_context)());
- }
}
#[derive(Copy, Clone)]
@@ -1131,7 +1125,7 @@ pub(crate) fn compute_match_usefulness(
arms: &[MatchArm],
) -> UsefulnessReport {
let mut matrix = Matrix::empty();
- let arm_usefulness: Vec<_> = arms
+ let arm_usefulness = arms
.iter()
.copied()
.map(|arm| {