Make some functions pub(super)
This commit is contained in:
parent
1ca9eb8ec3
commit
f6d2995fb8
@ -426,21 +426,21 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
data
|
data
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn data(&self) -> &RegionConstraintData<'tcx> {
|
pub(super) fn data(&self) -> &RegionConstraintData<'tcx> {
|
||||||
&self.data
|
&self.data
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start_snapshot(&mut self) -> RegionSnapshot {
|
pub(super) fn start_snapshot(&mut self) -> RegionSnapshot {
|
||||||
debug!("RegionConstraintCollector: start_snapshot");
|
debug!("RegionConstraintCollector: start_snapshot");
|
||||||
RegionSnapshot { any_unifications: self.any_unifications }
|
RegionSnapshot { any_unifications: self.any_unifications }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rollback_to(&mut self, snapshot: RegionSnapshot) {
|
pub(super) fn rollback_to(&mut self, snapshot: RegionSnapshot) {
|
||||||
debug!("RegionConstraintCollector: rollback_to({:?})", snapshot);
|
debug!("RegionConstraintCollector: rollback_to({:?})", snapshot);
|
||||||
self.any_unifications = snapshot.any_unifications;
|
self.any_unifications = snapshot.any_unifications;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_region_var(
|
pub(super) fn new_region_var(
|
||||||
&mut self,
|
&mut self,
|
||||||
universe: ty::UniverseIndex,
|
universe: ty::UniverseIndex,
|
||||||
origin: RegionVariableOrigin,
|
origin: RegionVariableOrigin,
|
||||||
@ -455,12 +455,12 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the universe for the given variable.
|
/// Returns the universe for the given variable.
|
||||||
pub fn var_universe(&self, vid: RegionVid) -> ty::UniverseIndex {
|
pub(super) fn var_universe(&self, vid: RegionVid) -> ty::UniverseIndex {
|
||||||
self.var_infos[vid].universe
|
self.var_infos[vid].universe
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the origin for the given variable.
|
/// Returns the origin for the given variable.
|
||||||
pub fn var_origin(&self, vid: RegionVid) -> RegionVariableOrigin {
|
pub(super) fn var_origin(&self, vid: RegionVid) -> RegionVariableOrigin {
|
||||||
self.var_infos[vid].origin
|
self.var_infos[vid].origin
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,7 +492,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
self.undo_log.push(AddVerify(index));
|
self.undo_log.push(AddVerify(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_given(&mut self, sub: Region<'tcx>, sup: ty::RegionVid) {
|
pub(super) fn add_given(&mut self, sub: Region<'tcx>, sup: ty::RegionVid) {
|
||||||
// cannot add givens once regions are resolved
|
// cannot add givens once regions are resolved
|
||||||
if self.data.givens.insert((sub, sup)) {
|
if self.data.givens.insert((sub, sup)) {
|
||||||
debug!("add_given({:?} <= {:?})", sub, sup);
|
debug!("add_given({:?} <= {:?})", sub, sup);
|
||||||
@ -501,7 +501,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn make_eqregion(
|
pub(super) fn make_eqregion(
|
||||||
&mut self,
|
&mut self,
|
||||||
origin: SubregionOrigin<'tcx>,
|
origin: SubregionOrigin<'tcx>,
|
||||||
sub: Region<'tcx>,
|
sub: Region<'tcx>,
|
||||||
@ -530,7 +530,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn member_constraint(
|
pub(super) fn member_constraint(
|
||||||
&mut self,
|
&mut self,
|
||||||
key: ty::OpaqueTypeKey<'tcx>,
|
key: ty::OpaqueTypeKey<'tcx>,
|
||||||
definition_span: Span,
|
definition_span: Span,
|
||||||
@ -554,7 +554,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(skip(self, origin), level = "debug")]
|
#[instrument(skip(self, origin), level = "debug")]
|
||||||
pub fn make_subregion(
|
pub(super) fn make_subregion(
|
||||||
&mut self,
|
&mut self,
|
||||||
origin: SubregionOrigin<'tcx>,
|
origin: SubregionOrigin<'tcx>,
|
||||||
sub: Region<'tcx>,
|
sub: Region<'tcx>,
|
||||||
@ -585,7 +585,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn verify_generic_bound(
|
pub(super) fn verify_generic_bound(
|
||||||
&mut self,
|
&mut self,
|
||||||
origin: SubregionOrigin<'tcx>,
|
origin: SubregionOrigin<'tcx>,
|
||||||
kind: GenericKind<'tcx>,
|
kind: GenericKind<'tcx>,
|
||||||
@ -595,7 +595,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
self.add_verify(Verify { kind, origin, region: sub, bound });
|
self.add_verify(Verify { kind, origin, region: sub, bound });
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lub_regions(
|
pub(super) fn lub_regions(
|
||||||
&mut self,
|
&mut self,
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
origin: SubregionOrigin<'tcx>,
|
origin: SubregionOrigin<'tcx>,
|
||||||
@ -613,7 +613,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn glb_regions(
|
pub(super) fn glb_regions(
|
||||||
&mut self,
|
&mut self,
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
origin: SubregionOrigin<'tcx>,
|
origin: SubregionOrigin<'tcx>,
|
||||||
@ -634,7 +634,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Resolves the passed RegionVid to the root RegionVid in the unification table
|
/// Resolves the passed RegionVid to the root RegionVid in the unification table
|
||||||
pub fn opportunistic_resolve_var(&mut self, rid: ty::RegionVid) -> ty::RegionVid {
|
pub(super) fn opportunistic_resolve_var(&mut self, rid: ty::RegionVid) -> ty::RegionVid {
|
||||||
self.unification_table().find(rid).vid
|
self.unification_table().find(rid).vid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user