1
Fork 0

rename IfEqBound to IfEq

This commit is contained in:
Niko Matsakis 2022-06-23 16:35:47 -04:00
parent 893b919e64
commit 27e0f7a886
5 changed files with 11 additions and 11 deletions

View file

@ -1191,8 +1191,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
debug!("eval_verify_bound(lower_bound={:?}, verify_bound={:?})", lower_bound, verify_bound); debug!("eval_verify_bound(lower_bound={:?}, verify_bound={:?})", lower_bound, verify_bound);
match verify_bound { match verify_bound {
VerifyBound::IfEqBound(verify_if_eq_b) => { VerifyBound::IfEq(verify_if_eq_b) => {
self.eval_if_eq_bound(infcx, param_env, generic_ty, lower_bound, *verify_if_eq_b) self.eval_if_eq(infcx, param_env, generic_ty, lower_bound, *verify_if_eq_b)
} }
VerifyBound::IsEmpty => { VerifyBound::IsEmpty => {
@ -1229,7 +1229,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
} }
} }
fn eval_if_eq_bound( fn eval_if_eq(
&self, &self,
infcx: &InferCtxt<'_, 'tcx>, infcx: &InferCtxt<'_, 'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
@ -1239,7 +1239,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
) -> bool { ) -> bool {
let generic_ty = self.normalize_to_scc_representatives(infcx.tcx, generic_ty); let generic_ty = self.normalize_to_scc_representatives(infcx.tcx, generic_ty);
let verify_if_eq_b = self.normalize_to_scc_representatives(infcx.tcx, verify_if_eq_b); let verify_if_eq_b = self.normalize_to_scc_representatives(infcx.tcx, verify_if_eq_b);
match test_type_match::extract_verify_if_eq_bound( match test_type_match::extract_verify_if_eq(
infcx.tcx, infcx.tcx,
param_env, param_env,
&verify_if_eq_b, &verify_if_eq_b,

View file

@ -822,8 +822,8 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
min: ty::Region<'tcx>, min: ty::Region<'tcx>,
) -> bool { ) -> bool {
match bound { match bound {
VerifyBound::IfEqBound(verify_if_eq_b) => { VerifyBound::IfEq(verify_if_eq_b) => {
match test_type_match::extract_verify_if_eq_bound( match test_type_match::extract_verify_if_eq(
self.tcx(), self.tcx(),
self.param_env, self.param_env,
verify_if_eq_b, verify_if_eq_b,

View file

@ -35,7 +35,7 @@ use crate::infer::region_constraints::VerifyIfEq;
/// very late in inference and hence cannot make use of the normal inference /// very late in inference and hence cannot make use of the normal inference
/// machinery. /// machinery.
#[tracing::instrument(level = "Debug", skip(tcx, param_env))] #[tracing::instrument(level = "Debug", skip(tcx, param_env))]
pub fn extract_verify_if_eq_bound<'tcx>( pub fn extract_verify_if_eq<'tcx>(
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
verify_if_eq_b: &ty::Binder<'tcx, VerifyIfEq<'tcx>>, verify_if_eq_b: &ty::Binder<'tcx, VerifyIfEq<'tcx>>,

View file

@ -173,7 +173,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
VerifyBound::OutlivedBy(r) VerifyBound::OutlivedBy(r)
} else { } else {
let verify_if_eq_b = binder.map_bound(|ty::OutlivesPredicate(ty, bound)| VerifyIfEq { ty, bound }); let verify_if_eq_b = binder.map_bound(|ty::OutlivesPredicate(ty, bound)| VerifyIfEq { ty, bound });
VerifyBound::IfEqBound(verify_if_eq_b) VerifyBound::IfEq(verify_if_eq_b)
} }
}); });

View file

@ -228,7 +228,7 @@ pub enum VerifyBound<'tcx> {
/// } /// }
/// } /// }
/// ``` /// ```
IfEqBound(ty::Binder<'tcx, VerifyIfEq<'tcx>>), IfEq(ty::Binder<'tcx, VerifyIfEq<'tcx>>),
/// Given a region `R`, expands to the function: /// Given a region `R`, expands to the function:
/// ///
@ -807,7 +807,7 @@ impl<'tcx> GenericKind<'tcx> {
impl<'tcx> VerifyBound<'tcx> { impl<'tcx> VerifyBound<'tcx> {
pub fn must_hold(&self) -> bool { pub fn must_hold(&self) -> bool {
match self { match self {
VerifyBound::IfEqBound(..) => false, VerifyBound::IfEq(..) => false,
VerifyBound::OutlivedBy(re) => re.is_static(), VerifyBound::OutlivedBy(re) => re.is_static(),
VerifyBound::IsEmpty => false, VerifyBound::IsEmpty => false,
VerifyBound::AnyBound(bs) => bs.iter().any(|b| b.must_hold()), VerifyBound::AnyBound(bs) => bs.iter().any(|b| b.must_hold()),
@ -817,7 +817,7 @@ impl<'tcx> VerifyBound<'tcx> {
pub fn cannot_hold(&self) -> bool { pub fn cannot_hold(&self) -> bool {
match self { match self {
VerifyBound::IfEqBound(..) => false, VerifyBound::IfEq(..) => false,
VerifyBound::IsEmpty => false, VerifyBound::IsEmpty => false,
VerifyBound::OutlivedBy(_) => false, VerifyBound::OutlivedBy(_) => false,
VerifyBound::AnyBound(bs) => bs.iter().all(|b| b.cannot_hold()), VerifyBound::AnyBound(bs) => bs.iter().all(|b| b.cannot_hold()),