1
Fork 0

Rename Skip to PrivateUninhabited

This commit is contained in:
Nadrieril 2024-02-28 17:56:01 +01:00
parent 39441e4cdd
commit c918893b63
5 changed files with 38 additions and 33 deletions

View file

@ -688,10 +688,9 @@ pub enum Constructor<Cx: TypeCx> {
/// Fake extra constructor for constructors that are not seen in the matrix, as explained at the
/// top of the file.
Missing,
/// Fake extra constructor that indicates that we should skip the column entirely. This is used
/// when a private field is empty, so that we don't observe its emptiness. Only used for
/// specialization.
Skip,
/// Fake extra constructor that indicates and empty field that is private. When we encounter one
/// we skip the column entirely so we don't observe its emptiness. Only used for specialization.
PrivateUninhabited,
}
impl<Cx: TypeCx> Clone for Constructor<Cx> {
@ -713,7 +712,7 @@ impl<Cx: TypeCx> Clone for Constructor<Cx> {
Constructor::NonExhaustive => Constructor::NonExhaustive,
Constructor::Hidden => Constructor::Hidden,
Constructor::Missing => Constructor::Missing,
Constructor::Skip => Constructor::Skip,
Constructor::PrivateUninhabited => Constructor::PrivateUninhabited,
}
}
}
@ -768,8 +767,8 @@ impl<Cx: TypeCx> Constructor<Cx> {
}
// Wildcards cover anything
(_, Wildcard) => true,
// `Skip` skips everything.
(Skip, _) => true,
// `PrivateUninhabited` skips everything.
(PrivateUninhabited, _) => true,
// Only a wildcard pattern can match these special constructors.
(Missing { .. } | NonExhaustive | Hidden, _) => false,