Function rustc_mir_build::thir::pattern::usefulness::compute_match_usefulness
source · pub(crate) fn compute_match_usefulness<'p, 'tcx>(
cx: &MatchCheckCtxt<'p, 'tcx>,
arms: &[MatchArm<'p, 'tcx>],
lint_root: HirId,
scrut_ty: Ty<'tcx>
) -> UsefulnessReport<'p, 'tcx>
Expand description
The entrypoint for the usefulness algorithm. Computes whether a match is exhaustive and which of its arms are reachable.
Note: the input patterns must have been lowered through
check_match::MatchVisitor::lower_pattern
.