@@ -162,6 +162,8 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
162162 type BoundRegion = ty:: BoundRegion ;
163163 type PlaceholderRegion = ty:: PlaceholderRegion ;
164164
165+ type RegionAssumptions = & ' tcx ty:: List < ty:: OutlivesPredicate < ' tcx , ty:: GenericArg < ' tcx > > > ;
166+
165167 type ParamEnv = ty:: ParamEnv < ' tcx > ;
166168 type Predicate = Predicate < ' tcx > ;
167169
@@ -874,6 +876,7 @@ pub struct CtxtInterners<'tcx> {
874876 offset_of : InternedSet < ' tcx , List < ( VariantIdx , FieldIdx ) > > ,
875877 valtree : InternedSet < ' tcx , ty:: ValTreeKind < ' tcx > > ,
876878 patterns : InternedSet < ' tcx , List < ty:: Pattern < ' tcx > > > ,
879+ outlives : InternedSet < ' tcx , List < ty:: OutlivesPredicate < ' tcx , ty:: GenericArg < ' tcx > > > > ,
877880}
878881
879882impl < ' tcx > CtxtInterners < ' tcx > {
@@ -911,6 +914,7 @@ impl<'tcx> CtxtInterners<'tcx> {
911914 offset_of : InternedSet :: with_capacity ( N ) ,
912915 valtree : InternedSet :: with_capacity ( N ) ,
913916 patterns : InternedSet :: with_capacity ( N ) ,
917+ outlives : InternedSet :: with_capacity ( N ) ,
914918 }
915919 }
916920
@@ -2692,6 +2696,7 @@ slice_interners!(
26922696 captures: intern_captures( & ' tcx ty:: CapturedPlace <' tcx>) ,
26932697 offset_of: pub mk_offset_of( ( VariantIdx , FieldIdx ) ) ,
26942698 patterns: pub mk_patterns( Pattern <' tcx>) ,
2699+ outlives: pub mk_outlives( ty:: OutlivesPredicate <' tcx, ty:: GenericArg <' tcx>>) ,
26952700) ;
26962701
26972702impl < ' tcx > TyCtxt < ' tcx > {
@@ -3107,6 +3112,17 @@ impl<'tcx> TyCtxt<'tcx> {
31073112 T :: collect_and_apply ( iter, |xs| self . mk_bound_variable_kinds ( xs) )
31083113 }
31093114
3115+ pub fn mk_outlives_from_iter < I , T > ( self , iter : I ) -> T :: Output
3116+ where
3117+ I : Iterator < Item = T > ,
3118+ T : CollectAndApply <
3119+ ty:: OutlivesPredicate < ' tcx , ty:: GenericArg < ' tcx > > ,
3120+ & ' tcx ty:: List < ty:: OutlivesPredicate < ' tcx , ty:: GenericArg < ' tcx > > > ,
3121+ > ,
3122+ {
3123+ T :: collect_and_apply ( iter, |xs| self . mk_outlives ( xs) )
3124+ }
3125+
31103126 /// Emit a lint at `span` from a lint struct (some type that implements `LintDiagnostic`,
31113127 /// typically generated by `#[derive(LintDiagnostic)]`).
31123128 #[ track_caller]
0 commit comments