@@ -18,7 +18,7 @@ use rustc_target::abi::{FieldIdx, Integer, VariantIdx, FIRST_VARIANT};
1818use crate :: constructor:: {
1919 IntRange , MaybeInfiniteInt , OpaqueId , RangeEnd , Slice , SliceKind , VariantVisibility ,
2020} ;
21- use crate :: { errors, Captures , SkipField , TypeCx } ;
21+ use crate :: { errors, Captures , PrivateUninhabitedField , TypeCx } ;
2222
2323use crate :: constructor:: Constructor :: * ;
2424
@@ -195,14 +195,16 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
195195 & ' a self ,
196196 ctor : & ' a Constructor < ' p , ' tcx > ,
197197 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 > {
200201 fn reveal_and_alloc < ' a , ' tcx > (
201202 cx : & ' a RustcMatchCheckCtxt < ' _ , ' tcx > ,
202203 iter : impl Iterator < Item = Ty < ' tcx > > ,
203- ) -> & ' a [ ( RevealedTy < ' tcx > , SkipField ) ] {
204+ ) -> & ' a [ ( RevealedTy < ' tcx > , PrivateUninhabitedField ) ] {
204205 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 ) ) ) ,
206208 )
207209 }
208210 let cx = self ;
@@ -230,7 +232,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
230232 || cx. tcx . features ( ) . min_exhaustive_patterns )
231233 && cx. is_uninhabited ( * ty) ;
232234 let skip = is_uninhabited && ( !is_visible || is_non_exhaustive) ;
233- ( ty, SkipField ( skip) )
235+ ( ty, PrivateUninhabitedField ( skip) )
234236 } ) ;
235237 cx. dropless_arena . alloc_from_iter ( tys)
236238 }
@@ -249,7 +251,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
249251 _ => bug ! ( "bad slice pattern {:?} {:?}" , ctor, ty) ,
250252 } ,
251253 Bool ( ..) | IntRange ( ..) | F32Range ( ..) | F64Range ( ..) | Str ( ..) | Opaque ( ..)
252- | NonExhaustive | Hidden | Missing | Skip | Wildcard => & [ ] ,
254+ | NonExhaustive | Hidden | Missing | PrivateUninhabited | Wildcard => & [ ] ,
253255 Or => {
254256 bug ! ( "called `Fields::wildcards` on an `Or` ctor" )
255257 }
@@ -277,7 +279,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
277279 Ref => 1 ,
278280 Slice ( slice) => slice. arity ( ) ,
279281 Bool ( ..) | IntRange ( ..) | F32Range ( ..) | F64Range ( ..) | Str ( ..) | Opaque ( ..)
280- | NonExhaustive | Hidden | Missing | Skip | Wildcard => 0 ,
282+ | NonExhaustive | Hidden | Missing | PrivateUninhabited | Wildcard => 0 ,
281283 Or => bug ! ( "The `Or` constructor doesn't have a fixed arity" ) ,
282284 }
283285 }
@@ -805,7 +807,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> {
805807 }
806808 }
807809 & Str ( value) => PatKind :: Constant { value } ,
808- Wildcard | NonExhaustive | Hidden | Skip => PatKind :: Wild ,
810+ Wildcard | NonExhaustive | Hidden | PrivateUninhabited => PatKind :: Wild ,
809811 Missing { .. } => bug ! (
810812 "trying to convert a `Missing` constructor into a `Pat`; this is probably a bug,
811813 `Missing` should have been processed in `apply_constructors`"
@@ -841,7 +843,8 @@ impl<'p, 'tcx: 'p> TypeCx for RustcMatchCheckCtxt<'p, 'tcx> {
841843 & ' a self ,
842844 ctor : & ' a crate :: constructor:: Constructor < Self > ,
843845 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+ {
845848 self . ctor_sub_tys ( ctor, * ty)
846849 }
847850 fn ctors_for_ty (
0 commit comments