Make TypeChecker::known_type_outlives_obligations
owned.
This avoids the need to arena allocate it. `ConstraintConversion` needs some simple lifetime adjustments to allow this.
This commit is contained in:
parent
4c8a23ab0d
commit
227ecc803f
3 changed files with 7 additions and 9 deletions
|
@ -37,7 +37,7 @@ pub(crate) struct ConstraintConversion<'a, 'tcx> {
|
||||||
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
|
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
|
||||||
implicit_region_bound: ty::Region<'tcx>,
|
implicit_region_bound: ty::Region<'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
known_type_outlives_obligations: &'tcx [ty::PolyTypeOutlivesPredicate<'tcx>],
|
known_type_outlives_obligations: &'a [ty::PolyTypeOutlivesPredicate<'tcx>],
|
||||||
locations: Locations,
|
locations: Locations,
|
||||||
span: Span,
|
span: Span,
|
||||||
category: ConstraintCategory<'tcx>,
|
category: ConstraintCategory<'tcx>,
|
||||||
|
@ -52,7 +52,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
|
||||||
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
|
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
|
||||||
implicit_region_bound: ty::Region<'tcx>,
|
implicit_region_bound: ty::Region<'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
known_type_outlives_obligations: &'tcx [ty::PolyTypeOutlivesPredicate<'tcx>],
|
known_type_outlives_obligations: &'a [ty::PolyTypeOutlivesPredicate<'tcx>],
|
||||||
locations: Locations,
|
locations: Locations,
|
||||||
span: Span,
|
span: Span,
|
||||||
category: ConstraintCategory<'tcx>,
|
category: ConstraintCategory<'tcx>,
|
||||||
|
|
|
@ -46,7 +46,7 @@ type NormalizedInputsAndOutput<'tcx> = Vec<Ty<'tcx>>;
|
||||||
pub(crate) struct CreateResult<'tcx> {
|
pub(crate) struct CreateResult<'tcx> {
|
||||||
pub(crate) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
pub(crate) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
||||||
pub(crate) region_bound_pairs: RegionBoundPairs<'tcx>,
|
pub(crate) region_bound_pairs: RegionBoundPairs<'tcx>,
|
||||||
pub(crate) known_type_outlives_obligations: &'tcx [ty::PolyTypeOutlivesPredicate<'tcx>],
|
pub(crate) known_type_outlives_obligations: Vec<ty::PolyTypeOutlivesPredicate<'tcx>>,
|
||||||
pub(crate) normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>,
|
pub(crate) normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,8 +250,6 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
|
||||||
|
|
||||||
known_type_outlives_obligations.push(outlives);
|
known_type_outlives_obligations.push(outlives);
|
||||||
}
|
}
|
||||||
let known_type_outlives_obligations =
|
|
||||||
self.infcx.tcx.arena.alloc_slice(&known_type_outlives_obligations);
|
|
||||||
|
|
||||||
let unnormalized_input_output_tys = self
|
let unnormalized_input_output_tys = self
|
||||||
.universal_regions
|
.universal_regions
|
||||||
|
@ -340,7 +338,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
|
||||||
&self.region_bound_pairs,
|
&self.region_bound_pairs,
|
||||||
self.implicit_region_bound,
|
self.implicit_region_bound,
|
||||||
param_env,
|
param_env,
|
||||||
known_type_outlives_obligations,
|
&known_type_outlives_obligations,
|
||||||
Locations::All(span),
|
Locations::All(span),
|
||||||
span,
|
span,
|
||||||
ConstraintCategory::Internal,
|
ConstraintCategory::Internal,
|
||||||
|
|
|
@ -844,7 +844,7 @@ struct TypeChecker<'a, 'tcx> {
|
||||||
/// all of the promoted items.
|
/// all of the promoted items.
|
||||||
user_type_annotations: &'a CanonicalUserTypeAnnotations<'tcx>,
|
user_type_annotations: &'a CanonicalUserTypeAnnotations<'tcx>,
|
||||||
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
|
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
|
||||||
known_type_outlives_obligations: &'tcx [ty::PolyTypeOutlivesPredicate<'tcx>],
|
known_type_outlives_obligations: Vec<ty::PolyTypeOutlivesPredicate<'tcx>>,
|
||||||
implicit_region_bound: ty::Region<'tcx>,
|
implicit_region_bound: ty::Region<'tcx>,
|
||||||
reported_errors: FxIndexSet<(Ty<'tcx>, Span)>,
|
reported_errors: FxIndexSet<(Ty<'tcx>, Span)>,
|
||||||
universal_regions: &'a UniversalRegions<'tcx>,
|
universal_regions: &'a UniversalRegions<'tcx>,
|
||||||
|
@ -1028,7 +1028,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
self.region_bound_pairs,
|
self.region_bound_pairs,
|
||||||
self.implicit_region_bound,
|
self.implicit_region_bound,
|
||||||
self.param_env,
|
self.param_env,
|
||||||
self.known_type_outlives_obligations,
|
&self.known_type_outlives_obligations,
|
||||||
locations,
|
locations,
|
||||||
locations.span(self.body),
|
locations.span(self.body),
|
||||||
category,
|
category,
|
||||||
|
@ -2790,7 +2790,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
self.region_bound_pairs,
|
self.region_bound_pairs,
|
||||||
self.implicit_region_bound,
|
self.implicit_region_bound,
|
||||||
self.param_env,
|
self.param_env,
|
||||||
self.known_type_outlives_obligations,
|
&self.known_type_outlives_obligations,
|
||||||
locations,
|
locations,
|
||||||
self.body.span, // irrelevant; will be overridden.
|
self.body.span, // irrelevant; will be overridden.
|
||||||
ConstraintCategory::Boring, // same as above.
|
ConstraintCategory::Boring, // same as above.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue