Rename HAS_PROJECTIONS to HAS_ALIASES etc.

This commit is contained in:
León Orell Valerian Liehr
2024-04-04 19:26:17 +02:00
parent 5dbaafdb93
commit 6f17b7f0ab
12 changed files with 21 additions and 17 deletions

View File

@@ -311,7 +311,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
let infcx = self.selcx.infcx;
if obligation.predicate.has_projections() {
if obligation.predicate.has_aliases() {
let mut obligations = Vec::new();
let predicate = normalize_with_depth_to(
&mut self.selcx,

View File

@@ -101,6 +101,8 @@ pub(super) fn needs_normalization<'tcx, T: TypeVisitable<TyCtxt<'tcx>>>(
value: &T,
reveal: Reveal,
) -> bool {
// This mirrors `ty::TypeFlags::HAS_ALIASES` except that we take `Reveal` into account.
let mut flags = ty::TypeFlags::HAS_TY_PROJECTION
| ty::TypeFlags::HAS_TY_WEAK
| ty::TypeFlags::HAS_TY_INHERENT

View File

@@ -432,7 +432,7 @@ pub(super) fn opt_normalize_projection_type<'a, 'b, 'tcx>(
let projected_term = selcx.infcx.resolve_vars_if_possible(projected_term);
let mut result = if projected_term.has_projections() {
let mut result = if projected_term.has_aliases() {
let normalized_ty = normalize_with_depth_to(
selcx,
param_env,
@@ -596,7 +596,7 @@ pub fn normalize_inherent_projection<'a, 'b, 'tcx>(
let ty = tcx.type_of(alias_ty.def_id).instantiate(tcx, args);
let mut ty = selcx.infcx.resolve_vars_if_possible(ty);
if ty.has_projections() {
if ty.has_aliases() {
ty = normalize_with_depth_to(selcx, param_env, cause.clone(), depth + 1, ty, obligations);
}

View File

@@ -15,7 +15,7 @@ where
type QueryResponse = T;
fn try_fast_path(_tcx: TyCtxt<'tcx>, key: &ParamEnvAnd<'tcx, Self>) -> Option<T> {
if !key.value.value.has_projections() { Some(key.value.value) } else { None }
if !key.value.value.has_aliases() { Some(key.value.value) } else { None }
}
fn perform_query(

View File

@@ -1066,7 +1066,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// so we will try to normalize the obligation and evaluate again.
// we will replace it with new solver in the future.
if EvaluationResult::EvaluatedToErr == result
&& fresh_trait_pred.has_projections()
&& fresh_trait_pred.has_aliases()
&& fresh_trait_pred.is_global()
{
let mut nested_obligations = Vec::new();