@@ -1246,15 +1246,15 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
1246
1246
}
1247
1247
1248
1248
#[ derive( Clone , Debug ) ]
1249
- crate enum Usefulness < ' tcx , ' p > {
1249
+ crate enum Usefulness < ' tcx > {
1250
1250
/// Carries a list of unreachable subpatterns. Used only in the presence of or-patterns.
1251
- Useful ( Vec < & ' p Pat < ' tcx > > ) ,
1251
+ Useful ( Vec < Span > ) ,
1252
1252
/// Carries a list of witnesses of non-exhaustiveness.
1253
1253
UsefulWithWitness ( Vec < Witness < ' tcx > > ) ,
1254
1254
NotUseful ,
1255
1255
}
1256
1256
1257
- impl < ' tcx , ' p > Usefulness < ' tcx , ' p > {
1257
+ impl < ' tcx > Usefulness < ' tcx > {
1258
1258
fn new_useful ( preference : WitnessPreference ) -> Self {
1259
1259
match preference {
1260
1260
ConstructWitness => UsefulWithWitness ( vec ! [ Witness ( vec![ ] ) ] ) ,
@@ -1269,7 +1269,7 @@ impl<'tcx, 'p> Usefulness<'tcx, 'p> {
1269
1269
}
1270
1270
}
1271
1271
1272
- fn apply_constructor (
1272
+ fn apply_constructor < ' p > (
1273
1273
self ,
1274
1274
cx : & MatchCheckCtxt < ' p , ' tcx > ,
1275
1275
ctor : & Constructor < ' tcx > ,
@@ -1828,7 +1828,7 @@ crate fn is_useful<'p, 'tcx>(
1828
1828
hir_id : HirId ,
1829
1829
is_under_guard : bool ,
1830
1830
is_top_level : bool ,
1831
- ) -> Usefulness < ' tcx , ' p > {
1831
+ ) -> Usefulness < ' tcx > {
1832
1832
let & Matrix ( ref rows) = matrix;
1833
1833
debug ! ( "is_useful({:#?}, {:#?})" , matrix, v) ;
1834
1834
@@ -1861,7 +1861,7 @@ crate fn is_useful<'p, 'tcx>(
1861
1861
any_is_useful = true ;
1862
1862
unreachable_pats. extend ( pats) ;
1863
1863
}
1864
- NotUseful => unreachable_pats. push ( v. head ( ) ) ,
1864
+ NotUseful => unreachable_pats. push ( v. head ( ) . span ) ,
1865
1865
UsefulWithWitness ( _) => {
1866
1866
bug ! ( "Encountered or-pat in `v` during exhaustiveness checking" )
1867
1867
}
@@ -2014,7 +2014,7 @@ fn is_useful_specialized<'p, 'tcx>(
2014
2014
witness_preference : WitnessPreference ,
2015
2015
hir_id : HirId ,
2016
2016
is_under_guard : bool ,
2017
- ) -> Usefulness < ' tcx , ' p > {
2017
+ ) -> Usefulness < ' tcx > {
2018
2018
debug ! ( "is_useful_specialized({:#?}, {:#?}, {:?})" , v, ctor, ty) ;
2019
2019
2020
2020
// We cache the result of `Fields::wildcards` because it is used a lot.
0 commit comments