Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e67adf4

Browse files
committed
Don't assume place validity when we don't know
1 parent 3cfcd4e commit e67adf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ impl<'p> MatchCheckCtx<'p> {
6565
arms: &[MatchArm<'p>],
6666
scrut_ty: Ty,
6767
) -> Result<UsefulnessReport<'p, Self>, ()> {
68-
compute_match_usefulness(self, arms, scrut_ty, PlaceValidity::ValidOnly, None)
68+
// FIXME: Determine place validity correctly. For now, err on the safe side.
69+
let place_validity = PlaceValidity::MaybeInvalid;
70+
compute_match_usefulness(self, arms, scrut_ty, place_validity, None)
6971
}
7072

7173
fn is_uninhabited(&self, ty: &Ty) -> bool {

0 commit comments

Comments
 (0)