diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2024-02-28 17:56:01 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2024-02-28 17:56:01 +0100 |
| commit | c918893b63022c1d810a71e8b7fa211b6aecd782 (patch) | |
| tree | f7afb94e6484fd7c6721eb415a8f114d99f9505f /compiler/rustc_pattern_analysis/src/constructor.rs | |
| parent | 39441e4cdd46c61be6b86e4bfe352d1e7d5af6fb (diff) | |
| download | rust-c918893b63022c1d810a71e8b7fa211b6aecd782.tar.gz rust-c918893b63022c1d810a71e8b7fa211b6aecd782.zip | |
Rename `Skip` to `PrivateUninhabited`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/constructor.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/constructor.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_pattern_analysis/src/constructor.rs b/compiler/rustc_pattern_analysis/src/constructor.rs index 26b0f5fc45d..1286022fe4d 100644 --- a/compiler/rustc_pattern_analysis/src/constructor.rs +++ b/compiler/rustc_pattern_analysis/src/constructor.rs @@ -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, |
