Don't assume place validity when we don't know

This commit is contained in:
Nadrieril 2024-03-17 16:35:47 +01:00
parent 3cfcd4ed96
commit e67adf40c9

View file

@ -65,7 +65,9 @@ impl<'p> MatchCheckCtx<'p> {
arms: &[MatchArm<'p>],
scrut_ty: Ty,
) -> Result<UsefulnessReport<'p, Self>, ()> {
compute_match_usefulness(self, arms, scrut_ty, PlaceValidity::ValidOnly, None)
// FIXME: Determine place validity correctly. For now, err on the safe side.
let place_validity = PlaceValidity::MaybeInvalid;
compute_match_usefulness(self, arms, scrut_ty, place_validity, None)
}
fn is_uninhabited(&self, ty: &Ty) -> bool {