Make ClosureOutlivesRequirement not rely on an unresolved type

This commit is contained in:
Michael Goulet 2022-10-19 01:20:24 +00:00
parent 91af4f5d0b
commit a6b5f95fb0
20 changed files with 94 additions and 93 deletions

View file

@ -632,7 +632,7 @@ impl<'tcx> InferCtxt<'tcx> {
/// creates query region constraints.
pub fn make_query_region_constraints<'tcx>(
tcx: TyCtxt<'tcx>,
outlives_obligations: impl Iterator<Item = (Ty<'tcx>, ty::Region<'tcx>, ConstraintCategory<'tcx>)>,
outlives_obligations: impl Iterator<Item = (Ty<'tcx>, ty::Region<'tcx>, ConstraintCategory)>,
region_constraints: &RegionConstraintData<'tcx>,
) -> QueryRegionConstraints<'tcx> {
let RegionConstraintData { constraints, verifys, givens, member_constraints } =

View file

@ -425,7 +425,7 @@ pub enum SubregionOrigin<'tcx> {
static_assert_size!(SubregionOrigin<'_>, 32);
impl<'tcx> SubregionOrigin<'tcx> {
pub fn to_constraint_category(&self) -> ConstraintCategory<'tcx> {
pub fn to_constraint_category(&self) -> ConstraintCategory {
match self {
Self::Subtype(type_trace) => type_trace.cause.to_constraint_category(),
Self::AscribeUserTypeProvePredicate(span) => ConstraintCategory::Predicate(*span),

View file

@ -210,7 +210,7 @@ pub trait TypeOutlivesDelegate<'tcx> {
origin: SubregionOrigin<'tcx>,
a: ty::Region<'tcx>,
b: ty::Region<'tcx>,
constraint_category: ConstraintCategory<'tcx>,
constraint_category: ConstraintCategory,
);
fn push_verify(
@ -259,7 +259,7 @@ where
origin: infer::SubregionOrigin<'tcx>,
ty: Ty<'tcx>,
region: ty::Region<'tcx>,
category: ConstraintCategory<'tcx>,
category: ConstraintCategory,
) {
assert!(!ty.has_escaping_bound_vars());
@ -273,7 +273,7 @@ where
origin: infer::SubregionOrigin<'tcx>,
components: &[Component<'tcx>],
region: ty::Region<'tcx>,
category: ConstraintCategory<'tcx>,
category: ConstraintCategory,
) {
for component in components.iter() {
let origin = origin.clone();
@ -529,7 +529,7 @@ impl<'cx, 'tcx> TypeOutlivesDelegate<'tcx> for &'cx InferCtxt<'tcx> {
origin: SubregionOrigin<'tcx>,
a: ty::Region<'tcx>,
b: ty::Region<'tcx>,
_constraint_category: ConstraintCategory<'tcx>,
_constraint_category: ConstraintCategory,
) {
self.sub_regions(origin, a, b)
}