Enable generation of non-exhaustiveness witnesses

This commit is contained in:
Dawer 2021-04-28 23:25:01 +05:00
parent c3c2893f30
commit 26baab5d28
3 changed files with 76 additions and 13 deletions

View file

@ -378,7 +378,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
} else {
&infer.type_of_expr[match_expr]
};
eprintln!("ExprValidator::validate_match2({:?})", match_expr_ty.kind(&Interner));
// eprintln!("ExprValidator::validate_match2({:?})", match_expr_ty.kind(&Interner));
let pattern_arena = usefulness::PatternArena::clone_from(&body.pats);
let cx = usefulness::MatchCheckCtx {
@ -408,6 +408,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
// }
let witnesses = report.non_exhaustiveness_witnesses;
eprintln!("compute_match_usefulness(..) -> {:?}", &witnesses);
if !witnesses.is_empty() {
if let Ok(source_ptr) = source_map.expr_syntax(id) {
let root = source_ptr.file_syntax(db.upcast());