Remove another Rc from RegionInferenceContext
This commit is contained in:
parent
4b46271841
commit
508d4a24d1
3 changed files with 8 additions and 6 deletions
|
@ -113,7 +113,7 @@ pub struct RegionInferenceContext<'tcx> {
|
|||
|
||||
/// Information about how the universally quantified regions in
|
||||
/// scope on this function relate to one another.
|
||||
universal_region_relations: Rc<UniversalRegionRelations<'tcx>>,
|
||||
universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
||||
}
|
||||
|
||||
/// Each time that `apply_member_constraint` is successful, it appends
|
||||
|
@ -243,11 +243,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
|||
///
|
||||
/// The `outlives_constraints` and `type_tests` are an initial set
|
||||
/// of constraints produced by the MIR type check.
|
||||
pub(crate) fn new(
|
||||
pub(in crate::borrow_check) fn new(
|
||||
var_infos: VarInfos,
|
||||
universal_regions: Rc<UniversalRegions<'tcx>>,
|
||||
placeholder_indices: Rc<PlaceholderIndices>,
|
||||
universal_region_relations: Rc<UniversalRegionRelations<'tcx>>,
|
||||
universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
||||
outlives_constraints: OutlivesConstraintSet,
|
||||
member_constraints_in: MemberConstraintSet<'tcx, RegionVid>,
|
||||
closure_bounds_mapping: FxHashMap<
|
||||
|
|
|
@ -15,6 +15,7 @@ use crate::borrow_check::{
|
|||
type_check::constraint_conversion,
|
||||
type_check::{Locations, MirTypeckRegionConstraints},
|
||||
universal_regions::UniversalRegions,
|
||||
Frozen,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -52,7 +53,7 @@ type RegionBoundPairs<'tcx> = Vec<(ty::Region<'tcx>, GenericKind<'tcx>)>;
|
|||
type NormalizedInputsAndOutput<'tcx> = Vec<Ty<'tcx>>;
|
||||
|
||||
crate struct CreateResult<'tcx> {
|
||||
crate universal_region_relations: Rc<UniversalRegionRelations<'tcx>>,
|
||||
pub(in crate::borrow_check) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
||||
crate region_bound_pairs: RegionBoundPairs<'tcx>,
|
||||
crate normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>,
|
||||
}
|
||||
|
@ -297,7 +298,7 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
|
|||
}
|
||||
|
||||
CreateResult {
|
||||
universal_region_relations: Rc::new(self.relations),
|
||||
universal_region_relations: Frozen::freeze(self.relations),
|
||||
region_bound_pairs: self.region_bound_pairs,
|
||||
normalized_inputs_and_output,
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ use crate::borrow_check::{
|
|||
renumber,
|
||||
type_check::free_region_relations::{CreateResult, UniversalRegionRelations},
|
||||
universal_regions::{DefiningTy, UniversalRegions},
|
||||
Frozen,
|
||||
};
|
||||
|
||||
macro_rules! span_mirbug {
|
||||
|
@ -828,7 +829,7 @@ struct BorrowCheckContext<'a, 'tcx> {
|
|||
|
||||
crate struct MirTypeckResults<'tcx> {
|
||||
crate constraints: MirTypeckRegionConstraints<'tcx>,
|
||||
crate universal_region_relations: Rc<UniversalRegionRelations<'tcx>>,
|
||||
pub(in crate::borrow_check) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
||||
crate opaque_type_values: FxHashMap<DefId, ty::ResolvedOpaqueTy<'tcx>>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue