@@ -162,6 +162,8 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
162
162
type BoundRegion = ty:: BoundRegion ;
163
163
type PlaceholderRegion = ty:: PlaceholderRegion ;
164
164
165
+ type RegionAssumptions = & ' tcx ty:: List < ty:: OutlivesPredicate < ' tcx , ty:: GenericArg < ' tcx > > > ;
166
+
165
167
type ParamEnv = ty:: ParamEnv < ' tcx > ;
166
168
type Predicate = Predicate < ' tcx > ;
167
169
@@ -874,6 +876,7 @@ pub struct CtxtInterners<'tcx> {
874
876
offset_of : InternedSet < ' tcx , List < ( VariantIdx , FieldIdx ) > > ,
875
877
valtree : InternedSet < ' tcx , ty:: ValTreeKind < ' tcx > > ,
876
878
patterns : InternedSet < ' tcx , List < ty:: Pattern < ' tcx > > > ,
879
+ outlives : InternedSet < ' tcx , List < ty:: OutlivesPredicate < ' tcx , ty:: GenericArg < ' tcx > > > > ,
877
880
}
878
881
879
882
impl < ' tcx > CtxtInterners < ' tcx > {
@@ -911,6 +914,7 @@ impl<'tcx> CtxtInterners<'tcx> {
911
914
offset_of : InternedSet :: with_capacity ( N ) ,
912
915
valtree : InternedSet :: with_capacity ( N ) ,
913
916
patterns : InternedSet :: with_capacity ( N ) ,
917
+ outlives : InternedSet :: with_capacity ( N ) ,
914
918
}
915
919
}
916
920
@@ -2692,6 +2696,7 @@ slice_interners!(
2692
2696
captures: intern_captures( & ' tcx ty:: CapturedPlace <' tcx>) ,
2693
2697
offset_of: pub mk_offset_of( ( VariantIdx , FieldIdx ) ) ,
2694
2698
patterns: pub mk_patterns( Pattern <' tcx>) ,
2699
+ outlives: pub mk_outlives( ty:: OutlivesPredicate <' tcx, ty:: GenericArg <' tcx>>) ,
2695
2700
) ;
2696
2701
2697
2702
impl < ' tcx > TyCtxt < ' tcx > {
@@ -3107,6 +3112,17 @@ impl<'tcx> TyCtxt<'tcx> {
3107
3112
T :: collect_and_apply ( iter, |xs| self . mk_bound_variable_kinds ( xs) )
3108
3113
}
3109
3114
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
+
3110
3126
/// Emit a lint at `span` from a lint struct (some type that implements `LintDiagnostic`,
3111
3127
/// typically generated by `#[derive(LintDiagnostic)]`).
3112
3128
#[ track_caller]
0 commit comments