Skip to content

Commit 8595565

Browse files
Add outlives to CoroutineWitnessTypes
1 parent 1caaf8a commit 8595565

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
154154
type BoundRegion = ty::BoundRegion;
155155
type PlaceholderRegion = ty::PlaceholderRegion;
156156

157+
type RegionAssumptions = &'tcx ty::List<ty::OutlivesPredicate<'tcx, ty::GenericArg<'tcx>>>;
158+
157159
type ParamEnv = ty::ParamEnv<'tcx>;
158160
type Predicate = Predicate<'tcx>;
159161

@@ -854,6 +856,7 @@ pub struct CtxtInterners<'tcx> {
854856
offset_of: InternedSet<'tcx, List<(VariantIdx, FieldIdx)>>,
855857
valtree: InternedSet<'tcx, ty::ValTreeKind<'tcx>>,
856858
patterns: InternedSet<'tcx, List<ty::Pattern<'tcx>>>,
859+
outlives: InternedSet<'tcx, List<ty::OutlivesPredicate<'tcx, ty::GenericArg<'tcx>>>>,
857860
}
858861

859862
impl<'tcx> CtxtInterners<'tcx> {
@@ -891,6 +894,7 @@ impl<'tcx> CtxtInterners<'tcx> {
891894
offset_of: InternedSet::with_capacity(N),
892895
valtree: InternedSet::with_capacity(N),
893896
patterns: InternedSet::with_capacity(N),
897+
outlives: InternedSet::with_capacity(N),
894898
}
895899
}
896900

@@ -2685,6 +2689,7 @@ slice_interners!(
26852689
captures: intern_captures(&'tcx ty::CapturedPlace<'tcx>),
26862690
offset_of: pub mk_offset_of((VariantIdx, FieldIdx)),
26872691
patterns: pub mk_patterns(Pattern<'tcx>),
2692+
outlives: pub mk_outlives(ty::OutlivesPredicate<'tcx, ty::GenericArg<'tcx>>),
26882693
);
26892694

26902695
impl<'tcx> TyCtxt<'tcx> {

compiler/rustc_middle/src/ty/structural_impls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,4 +779,5 @@ list_fold! {
779779
&'tcx ty::List<ty::PolyExistentialPredicate<'tcx>> : mk_poly_existential_predicates,
780780
&'tcx ty::List<PlaceElem<'tcx>> : mk_place_elems,
781781
&'tcx ty::List<ty::Pattern<'tcx>> : mk_patterns,
782+
&'tcx ty::List<ty::OutlivesPredicate<'tcx, ty::GenericArg<'tcx>>> : mk_outlives,
782783
}

compiler/rustc_middle/src/ty/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ impl<'tcx> TyCtxt<'tcx> {
766766
}),
767767
);
768768
ty::EarlyBinder::bind(ty::Binder::bind_with_vars(
769-
ty::CoroutineWitnessTypes { types: bound_tys },
769+
ty::CoroutineWitnessTypes { types: bound_tys, assumptions: ty::List::empty() },
770770
self.mk_bound_variable_kinds(&vars),
771771
))
772772
}

compiler/rustc_type_ir/src/interner.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ pub trait Interner:
139139
type BoundRegion: Copy + Debug + Hash + Eq + BoundVarLike<Self>;
140140
type PlaceholderRegion: PlaceholderLike;
141141

142+
type RegionAssumptions: Copy
143+
+ Debug
144+
+ Hash
145+
+ Eq
146+
+ SliceLike<Item = ty::OutlivesPredicate<Self, Self::GenericArg>>
147+
+ TypeFoldable<Self>;
148+
142149
// Predicates
143150
type ParamEnv: ParamEnv<Self>;
144151
type Predicate: Predicate<Self>;

compiler/rustc_type_ir/src/ty_kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,5 +1172,5 @@ pub struct FnHeader<I: Interner> {
11721172
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic)]
11731173
pub struct CoroutineWitnessTypes<I: Interner> {
11741174
pub types: I::Tys,
1175-
pub assumptions:
1175+
pub assumptions: I::RegionAssumptions,
11761176
}

0 commit comments

Comments
 (0)