@@ -18,7 +18,7 @@ use rustc_target::abi::{FieldIdx, Integer, VariantIdx, FIRST_VARIANT};
18
18
use crate :: constructor:: {
19
19
IntRange , MaybeInfiniteInt , OpaqueId , RangeEnd , Slice , SliceKind , VariantVisibility ,
20
20
} ;
21
- use crate :: { errors, Captures , SkipField , TypeCx } ;
21
+ use crate :: { errors, Captures , PrivateUninhabitedField , TypeCx } ;
22
22
23
23
use crate :: constructor:: Constructor :: * ;
24
24
@@ -195,14 +195,16 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
195
195
& ' a self ,
196
196
ctor : & ' a Constructor < ' p , ' tcx > ,
197
197
ty : RevealedTy < ' tcx > ,
198
- ) -> impl Iterator < Item = ( RevealedTy < ' tcx > , SkipField ) > + ExactSizeIterator + Captures < ' a >
199
- {
198
+ ) -> impl Iterator < Item = ( RevealedTy < ' tcx > , PrivateUninhabitedField ) >
199
+ + ExactSizeIterator
200
+ + Captures < ' a > {
200
201
fn reveal_and_alloc < ' a , ' tcx > (
201
202
cx : & ' a RustcMatchCheckCtxt < ' _ , ' tcx > ,
202
203
iter : impl Iterator < Item = Ty < ' tcx > > ,
203
- ) -> & ' a [ ( RevealedTy < ' tcx > , SkipField ) ] {
204
+ ) -> & ' a [ ( RevealedTy < ' tcx > , PrivateUninhabitedField ) ] {
204
205
cx. dropless_arena . alloc_from_iter (
205
- iter. map ( |ty| cx. reveal_opaque_ty ( ty) ) . map ( |ty| ( ty, SkipField ( false ) ) ) ,
206
+ iter. map ( |ty| cx. reveal_opaque_ty ( ty) )
207
+ . map ( |ty| ( ty, PrivateUninhabitedField ( false ) ) ) ,
206
208
)
207
209
}
208
210
let cx = self ;
@@ -230,7 +232,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
230
232
|| cx. tcx . features ( ) . min_exhaustive_patterns )
231
233
&& cx. is_uninhabited ( * ty) ;
232
234
let skip = is_uninhabited && ( !is_visible || is_non_exhaustive) ;
233
- ( ty, SkipField ( skip) )
235
+ ( ty, PrivateUninhabitedField ( skip) )
234
236
} ) ;
235
237
cx. dropless_arena . alloc_from_iter ( tys)
236
238
}
@@ -249,7 +251,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
249
251
_ => bug ! ( "bad slice pattern {:?} {:?}" , ctor, ty) ,
250
252
} ,
251
253
Bool ( ..) | IntRange ( ..) | F32Range ( ..) | F64Range ( ..) | Str ( ..) | Opaque ( ..)
252
- | NonExhaustive | Hidden | Missing | Skip | Wildcard => & [ ] ,
254
+ | NonExhaustive | Hidden | Missing | PrivateUninhabited | Wildcard => & [ ] ,
253
255
Or => {
254
256
bug ! ( "called `Fields::wildcards` on an `Or` ctor" )
255
257
}
@@ -277,7 +279,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
277
279
Ref => 1 ,
278
280
Slice ( slice) => slice. arity ( ) ,
279
281
Bool ( ..) | IntRange ( ..) | F32Range ( ..) | F64Range ( ..) | Str ( ..) | Opaque ( ..)
280
- | NonExhaustive | Hidden | Missing | Skip | Wildcard => 0 ,
282
+ | NonExhaustive | Hidden | Missing | PrivateUninhabited | Wildcard => 0 ,
281
283
Or => bug ! ( "The `Or` constructor doesn't have a fixed arity" ) ,
282
284
}
283
285
}
@@ -805,7 +807,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
805
807
}
806
808
}
807
809
& Str ( value) => PatKind :: Constant { value } ,
808
- Wildcard | NonExhaustive | Hidden | Skip => PatKind :: Wild ,
810
+ Wildcard | NonExhaustive | Hidden | PrivateUninhabited => PatKind :: Wild ,
809
811
Missing { .. } => bug ! (
810
812
"trying to convert a `Missing` constructor into a `Pat`; this is probably a bug,
811
813
`Missing` should have been processed in `apply_constructors`"
@@ -841,7 +843,8 @@ impl<'p, 'tcx: 'p> TypeCx for RustcMatchCheckCtxt<'p, 'tcx> {
841
843
& ' a self ,
842
844
ctor : & ' a crate :: constructor:: Constructor < Self > ,
843
845
ty : & ' a Self :: Ty ,
844
- ) -> impl Iterator < Item = ( Self :: Ty , SkipField ) > + ExactSizeIterator + Captures < ' a > {
846
+ ) -> impl Iterator < Item = ( Self :: Ty , PrivateUninhabitedField ) > + ExactSizeIterator + Captures < ' a >
847
+ {
845
848
self . ctor_sub_tys ( ctor, * ty)
846
849
}
847
850
fn ctors_for_ty (
0 commit comments