Reveal opaque types in exhaustiveness checking

This commit is contained in:
Nadrieril 2023-11-16 04:28:22 +01:00
parent 7e4924b55d
commit 2a87bae48d
7 changed files with 76 additions and 42 deletions

View file

@ -62,7 +62,8 @@ pub trait TypeCx: Sized + Clone + fmt::Debug {
/// patterns during analysis.
type PatData: Clone + Default;
fn is_opaque_ty(ty: Self::Ty) -> bool;
/// FIXME(Nadrieril): `Cx` should only give us revealed types.
fn reveal_opaque_ty(&self, ty: Self::Ty) -> Self::Ty;
fn is_exhaustive_patterns_feature_on(&self) -> bool;
/// The number of fields for this constructor.