Clarify the situation with dummy patterns and PatData

Use an explicit `Option` instead of requiring a `Default` bound
This commit is contained in:
Nadrieril
2023-12-22 23:47:44 +01:00
parent f6af7478ba
commit 5fccaee59c
6 changed files with 22 additions and 20 deletions

View File

@@ -58,9 +58,8 @@ pub trait TypeCx: Sized + fmt::Debug {
type StrLit: Clone + PartialEq + fmt::Debug;
/// Extra data to store in a match arm.
type ArmData: Copy + Clone + fmt::Debug;
/// Extra data to store in a pattern. `Default` needed when we create fictitious wildcard
/// patterns during analysis.
type PatData: Clone + Default;
/// Extra data to store in a pattern.
type PatData: Clone;
/// FIXME(Nadrieril): `Cx` should only give us revealed types.
fn reveal_opaque_ty(&self, ty: Self::Ty) -> Self::Ty;