@@ -7,7 +7,7 @@ use crate::mir::{Field, ProjectionKind};
7
7
use crate :: ty:: fold:: { ir:: TypeSuperFoldable , FallibleTypeFolder , TypeFoldable } ;
8
8
use crate :: ty:: print:: { with_no_trimmed_paths, FmtPrinter , Printer } ;
9
9
use crate :: ty:: visit:: { ir:: TypeSuperVisitable , TypeVisitable , TypeVisitor } ;
10
- use crate :: ty:: { self , ir, AliasTy , InferConst , Lift , Term , TermKind , Ty , TyCtxt } ;
10
+ use crate :: ty:: { self , ir, AliasTy , InferConst , Interner , Lift , Term , TermKind , Ty , TyCtxt } ;
11
11
use rustc_data_structures:: functor:: IdFunctor ;
12
12
use rustc_hir:: def:: Namespace ;
13
13
use rustc_index:: vec:: { Idx , IndexVec } ;
@@ -375,28 +375,28 @@ impl<'tcx> ir::TypeVisitable<TyCtxt<'tcx>> for ty::AdtDef<'tcx> {
375
375
}
376
376
}
377
377
378
- impl < ' tcx , T : TypeFoldable < ' tcx > , U : TypeFoldable < ' tcx > > ir:: TypeFoldable < TyCtxt < ' tcx > > for ( T , U ) {
379
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > (
378
+ impl < I : Interner , T : ir :: TypeFoldable < I > , U : ir :: TypeFoldable < I > > ir:: TypeFoldable < I > for ( T , U ) {
379
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > (
380
380
self ,
381
381
folder : & mut F ,
382
382
) -> Result < ( T , U ) , F :: Error > {
383
383
Ok ( ( self . 0 . try_fold_with ( folder) ?, self . 1 . try_fold_with ( folder) ?) )
384
384
}
385
385
}
386
386
387
- impl < ' tcx , T : TypeVisitable < ' tcx > , U : TypeVisitable < ' tcx > > ir:: TypeVisitable < TyCtxt < ' tcx > >
387
+ impl < I : Interner , T : ir :: TypeVisitable < I > , U : ir :: TypeVisitable < I > > ir:: TypeVisitable < I >
388
388
for ( T , U )
389
389
{
390
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
390
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
391
391
self . 0 . visit_with ( visitor) ?;
392
392
self . 1 . visit_with ( visitor)
393
393
}
394
394
}
395
395
396
- impl < ' tcx , A : TypeFoldable < ' tcx > , B : TypeFoldable < ' tcx > , C : TypeFoldable < ' tcx > >
397
- ir:: TypeFoldable < TyCtxt < ' tcx > > for ( A , B , C )
396
+ impl < I : Interner , A : ir :: TypeFoldable < I > , B : ir :: TypeFoldable < I > , C : ir :: TypeFoldable < I > >
397
+ ir:: TypeFoldable < I > for ( A , B , C )
398
398
{
399
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > (
399
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > (
400
400
self ,
401
401
folder : & mut F ,
402
402
) -> Result < ( A , B , C ) , F :: Error > {
@@ -408,44 +408,44 @@ impl<'tcx, A: TypeFoldable<'tcx>, B: TypeFoldable<'tcx>, C: TypeFoldable<'tcx>>
408
408
}
409
409
}
410
410
411
- impl < ' tcx , A : TypeVisitable < ' tcx > , B : TypeVisitable < ' tcx > , C : TypeVisitable < ' tcx > >
412
- ir:: TypeVisitable < TyCtxt < ' tcx > > for ( A , B , C )
411
+ impl < I : Interner , A : ir :: TypeVisitable < I > , B : ir :: TypeVisitable < I > , C : ir :: TypeVisitable < I > >
412
+ ir:: TypeVisitable < I > for ( A , B , C )
413
413
{
414
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
414
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
415
415
self . 0 . visit_with ( visitor) ?;
416
416
self . 1 . visit_with ( visitor) ?;
417
417
self . 2 . visit_with ( visitor)
418
418
}
419
419
}
420
420
421
421
EnumTypeTraversalImpl ! {
422
- impl <' tcx , T > TypeFoldable <' tcx > for Option <T > {
422
+ impl <I , T > TypeFoldable <I > for Option <T > {
423
423
( Some ) ( a) ,
424
424
( None ) ,
425
- } where T : TypeFoldable <' tcx >
425
+ } where I : Interner , T : ir :: TypeFoldable <I >
426
426
}
427
427
EnumTypeTraversalImpl ! {
428
- impl <' tcx , T > TypeVisitable <' tcx > for Option <T > {
428
+ impl <I , T > TypeVisitable <I > for Option <T > {
429
429
( Some ) ( a) ,
430
430
( None ) ,
431
- } where T : TypeVisitable <' tcx >
431
+ } where I : Interner , T : ir :: TypeVisitable <I >
432
432
}
433
433
434
434
EnumTypeTraversalImpl ! {
435
- impl <' tcx , T , E > TypeFoldable <' tcx > for Result <T , E > {
435
+ impl <I , T , E > TypeFoldable <I > for Result <T , E > {
436
436
( Ok ) ( a) ,
437
437
( Err ) ( a) ,
438
- } where T : TypeFoldable <' tcx >, E : TypeFoldable <' tcx >,
438
+ } where I : Interner , T : ir :: TypeFoldable <I >, E : ir :: TypeFoldable <I >,
439
439
}
440
440
EnumTypeTraversalImpl ! {
441
- impl <' tcx , T , E > TypeVisitable <' tcx > for Result <T , E > {
441
+ impl <I , T , E > TypeVisitable <I > for Result <T , E > {
442
442
( Ok ) ( a) ,
443
443
( Err ) ( a) ,
444
- } where T : TypeVisitable <' tcx >, E : TypeVisitable <' tcx >,
444
+ } where I : Interner , T : ir :: TypeVisitable <I >, E : ir :: TypeVisitable <I >,
445
445
}
446
446
447
- impl < ' tcx , T : TypeFoldable < ' tcx > > ir:: TypeFoldable < TyCtxt < ' tcx > > for Rc < T > {
448
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > (
447
+ impl < I : Interner , T : ir :: TypeFoldable < I > > ir:: TypeFoldable < I > for Rc < T > {
448
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > (
449
449
mut self ,
450
450
folder : & mut F ,
451
451
) -> Result < Self , F :: Error > {
@@ -484,14 +484,14 @@ impl<'tcx, T: TypeFoldable<'tcx>> ir::TypeFoldable<TyCtxt<'tcx>> for Rc<T> {
484
484
}
485
485
}
486
486
487
- impl < ' tcx , T : TypeVisitable < ' tcx > > ir:: TypeVisitable < TyCtxt < ' tcx > > for Rc < T > {
488
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
487
+ impl < I : Interner , T : ir :: TypeVisitable < I > > ir:: TypeVisitable < I > for Rc < T > {
488
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
489
489
( * * self ) . visit_with ( visitor)
490
490
}
491
491
}
492
492
493
- impl < ' tcx , T : TypeFoldable < ' tcx > > ir:: TypeFoldable < TyCtxt < ' tcx > > for Arc < T > {
494
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > (
493
+ impl < I : Interner , T : ir :: TypeFoldable < I > > ir:: TypeFoldable < I > for Arc < T > {
494
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > (
495
495
mut self ,
496
496
folder : & mut F ,
497
497
) -> Result < Self , F :: Error > {
@@ -530,50 +530,50 @@ impl<'tcx, T: TypeFoldable<'tcx>> ir::TypeFoldable<TyCtxt<'tcx>> for Arc<T> {
530
530
}
531
531
}
532
532
533
- impl < ' tcx , T : TypeVisitable < ' tcx > > ir:: TypeVisitable < TyCtxt < ' tcx > > for Arc < T > {
534
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
533
+ impl < I : Interner , T : ir :: TypeVisitable < I > > ir:: TypeVisitable < I > for Arc < T > {
534
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
535
535
( * * self ) . visit_with ( visitor)
536
536
}
537
537
}
538
538
539
- impl < ' tcx , T : TypeFoldable < ' tcx > > ir:: TypeFoldable < TyCtxt < ' tcx > > for Box < T > {
540
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
539
+ impl < I : Interner , T : ir :: TypeFoldable < I > > ir:: TypeFoldable < I > for Box < T > {
540
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
541
541
self . try_map_id ( |value| value. try_fold_with ( folder) )
542
542
}
543
543
}
544
544
545
- impl < ' tcx , T : TypeVisitable < ' tcx > > ir:: TypeVisitable < TyCtxt < ' tcx > > for Box < T > {
546
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
545
+ impl < I : Interner , T : ir :: TypeVisitable < I > > ir:: TypeVisitable < I > for Box < T > {
546
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
547
547
( * * self ) . visit_with ( visitor)
548
548
}
549
549
}
550
550
551
- impl < ' tcx , T : TypeFoldable < ' tcx > > ir:: TypeFoldable < TyCtxt < ' tcx > > for Vec < T > {
552
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
551
+ impl < I : Interner , T : ir :: TypeFoldable < I > > ir:: TypeFoldable < I > for Vec < T > {
552
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
553
553
self . try_map_id ( |t| t. try_fold_with ( folder) )
554
554
}
555
555
}
556
556
557
- impl < ' tcx , T : TypeVisitable < ' tcx > > ir:: TypeVisitable < TyCtxt < ' tcx > > for Vec < T > {
558
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
557
+ impl < I : Interner , T : ir :: TypeVisitable < I > > ir:: TypeVisitable < I > for Vec < T > {
558
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
559
559
self . iter ( ) . try_for_each ( |t| t. visit_with ( visitor) )
560
560
}
561
561
}
562
562
563
- impl < ' tcx , T : TypeVisitable < ' tcx > > ir:: TypeVisitable < TyCtxt < ' tcx > > for & [ T ] {
564
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
563
+ impl < I : Interner , T : ir :: TypeVisitable < I > > ir:: TypeVisitable < I > for & [ T ] {
564
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
565
565
self . iter ( ) . try_for_each ( |t| t. visit_with ( visitor) )
566
566
}
567
567
}
568
568
569
- impl < ' tcx , T : TypeFoldable < ' tcx > > ir:: TypeFoldable < TyCtxt < ' tcx > > for Box < [ T ] > {
570
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
569
+ impl < I : Interner , T : ir :: TypeFoldable < I > > ir:: TypeFoldable < I > for Box < [ T ] > {
570
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
571
571
self . try_map_id ( |t| t. try_fold_with ( folder) )
572
572
}
573
573
}
574
574
575
- impl < ' tcx , T : TypeVisitable < ' tcx > > ir:: TypeVisitable < TyCtxt < ' tcx > > for Box < [ T ] > {
576
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
575
+ impl < I : Interner , T : ir :: TypeVisitable < I > > ir:: TypeVisitable < I > for Box < [ T ] > {
576
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
577
577
self . iter ( ) . try_for_each ( |t| t. visit_with ( visitor) )
578
578
}
579
579
}
@@ -790,14 +790,14 @@ impl<'tcx> ir::TypeFoldable<TyCtxt<'tcx>> for &'tcx ty::List<ty::Predicate<'tcx>
790
790
}
791
791
}
792
792
793
- impl < ' tcx , T : TypeFoldable < ' tcx > , I : Idx > ir:: TypeFoldable < TyCtxt < ' tcx > > for IndexVec < I , T > {
794
- fn try_fold_with < F : FallibleTypeFolder < ' tcx > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
793
+ impl < I : Interner , T : ir :: TypeFoldable < I > , Ix : Idx > ir:: TypeFoldable < I > for IndexVec < Ix , T > {
794
+ fn try_fold_with < F : ir :: FallibleTypeFolder < I > > ( self , folder : & mut F ) -> Result < Self , F :: Error > {
795
795
self . try_map_id ( |x| x. try_fold_with ( folder) )
796
796
}
797
797
}
798
798
799
- impl < ' tcx , T : TypeVisitable < ' tcx > , I : Idx > ir:: TypeVisitable < TyCtxt < ' tcx > > for IndexVec < I , T > {
800
- fn visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
799
+ impl < I : Interner , T : ir :: TypeVisitable < I > , Ix : Idx > ir:: TypeVisitable < I > for IndexVec < Ix , T > {
800
+ fn visit_with < V : ir :: TypeVisitor < I > > ( & self , visitor : & mut V ) -> ControlFlow < V :: BreakTy > {
801
801
self . iter ( ) . try_for_each ( |t| t. visit_with ( visitor) )
802
802
}
803
803
}
0 commit comments