@@ -363,26 +363,23 @@ impl<'p, 'tcx> PatStack<'p, 'tcx> {
363
363
self . 0 . len ( )
364
364
}
365
365
366
- fn head < ' a , ' p2 > ( & ' a self ) -> & ' p2 Pat < ' tcx >
367
- where
368
- ' p : ' p2 ,
369
- {
366
+ fn head < ' a > ( & ' a self ) -> & ' p Pat < ' tcx > {
370
367
self . 0 [ 0 ]
371
368
}
372
369
fn iter ( & self ) -> impl Iterator < Item = & Pat < ' tcx > > {
373
370
self . 0 . iter ( ) . map ( |p| * p)
374
371
}
375
372
376
373
/// This computes `S(constructor, self)`. See top of the file for explanations.
377
- fn specialize < ' a , ' p2 > (
374
+ fn specialize < ' a , ' q > (
378
375
& self ,
379
376
cx : & MatchCheckCtxt < ' a , ' tcx > ,
380
377
constructor : & Constructor < ' tcx > ,
381
- ctor_wild_subpatterns : & [ & ' p2 Pat < ' tcx > ] ,
382
- ) -> SmallVec < [ PatStack < ' p2 , ' tcx > ; 1 ] >
378
+ ctor_wild_subpatterns : & [ & ' q Pat < ' tcx > ] ,
379
+ ) -> SmallVec < [ PatStack < ' q , ' tcx > ; 1 ] >
383
380
where
384
- ' a : ' p2 ,
385
- ' p : ' p2 ,
381
+ ' a : ' q ,
382
+ ' p : ' q ,
386
383
{
387
384
let new_heads = specialize_one_pattern ( cx, self . head ( ) , constructor, ctor_wild_subpatterns) ;
388
385
let result = new_heads
@@ -426,29 +423,25 @@ impl<'p, 'tcx> Matrix<'p, 'tcx> {
426
423
427
424
/// Iterate over the first component of each row
428
425
// Can't return impl Iterator because of hidden lifetime capture.
429
- fn heads < ' a , ' p2 > (
426
+ fn heads < ' a > (
430
427
& ' a self ,
431
428
) -> iter:: Map <
432
429
std:: slice:: Iter < ' a , PatStack < ' p , ' tcx > > ,
433
- impl FnMut ( & ' a PatStack < ' p , ' tcx > ) -> & ' p2 Pat < ' tcx > ,
434
- >
435
- where
436
- ' p : ' p2 ,
437
- ' a : ' p2 ,
438
- {
430
+ impl FnMut ( & ' a PatStack < ' p , ' tcx > ) -> & ' p Pat < ' tcx > ,
431
+ > {
439
432
self . 0 . iter ( ) . map ( |r| r. head ( ) )
440
433
}
441
434
442
435
/// This computes `S(constructor, self)`. See top of the file for explanations.
443
- fn specialize < ' a , ' p2 > (
436
+ fn specialize < ' a , ' q > (
444
437
& self ,
445
438
cx : & MatchCheckCtxt < ' a , ' tcx > ,
446
439
constructor : & Constructor < ' tcx > ,
447
- ctor_wild_subpatterns : & [ & ' p2 Pat < ' tcx > ] ,
448
- ) -> Matrix < ' p2 , ' tcx >
440
+ ctor_wild_subpatterns : & [ & ' q Pat < ' tcx > ] ,
441
+ ) -> Matrix < ' q , ' tcx >
449
442
where
450
- ' a : ' p2 ,
451
- ' p : ' p2 ,
443
+ ' a : ' q ,
444
+ ' p : ' q ,
452
445
{
453
446
Matrix (
454
447
self . 0
@@ -2013,9 +2006,9 @@ fn patterns_for_variant<'p, 'tcx>(
2013
2006
///
2014
2007
/// Structure patterns with a partial wild pattern (Foo { a: 42, .. }) have their missing
2015
2008
/// fields filled with wild patterns.
2016
- fn specialize_one_pattern < ' p , ' a : ' p , ' p2 : ' p , ' tcx > (
2009
+ fn specialize_one_pattern < ' p , ' a : ' p , ' q : ' p , ' tcx > (
2017
2010
cx : & MatchCheckCtxt < ' a , ' tcx > ,
2018
- mut pat : & ' p2 Pat < ' tcx > ,
2011
+ mut pat : & ' q Pat < ' tcx > ,
2019
2012
constructor : & Constructor < ' tcx > ,
2020
2013
ctor_wild_subpatterns : & [ & ' p Pat < ' tcx > ] ,
2021
2014
) -> SmallVec < [ PatStack < ' p , ' tcx > ; 1 ] > {
0 commit comments