};
use crate::infer::error_reporting::{TyCategory, TypeAnnotationNeeded as ErrorCode};
use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
-use crate::infer::InferCtxtExt as _;
use crate::infer::{self, InferCtxt, TyCtxtInferExt};
use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
-use crate::traits::query::normalize::AtExt as _;
+use crate::traits::query::normalize::QueryNormalizeExt as _;
use crate::traits::specialize::to_pretty_impl_header;
+use crate::traits::NormalizeExt;
use on_unimplemented::OnUnimplementedNote;
use on_unimplemented::TypeErrCtxtExt as _;
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
bound_predicate.rebind(data),
);
let mut obligations = vec![];
+ // FIXME(normalization): Change this to use `At::normalize`
let normalized_ty = super::normalize_projection_type(
&mut selcx,
obligation.param_env,
let infcx = self.tcx.infer_ctxt().build();
infcx
.at(&ObligationCause::dummy(), ty::ParamEnv::empty())
- .normalize(candidate)
+ .query_normalize(candidate)
.map_or(candidate, |normalized| normalized.value)
};
pred.fold_with(&mut ParamToVarFolder { infcx: self, var_map: Default::default() });
let InferOk { value: cleaned_pred, .. } =
- self.infcx.partially_normalize_associated_types_in(
- ObligationCause::dummy(),
- param_env,
- cleaned_pred,
- );
+ self.infcx.at(&ObligationCause::dummy(), param_env).normalize(cleaned_pred);
let obligation =
Obligation::new(self.tcx, ObligationCause::dummy(), param_env, cleaned_pred);
- // We don't use `InferCtxt::predicate_may_hold` because that
- // will re-run predicates that overflow locally, which ends up
- // taking a really long time to compute.
- self.evaluate_obligation(&obligation).map_or(false, |eval| eval.may_apply())
+ self.predicate_may_hold(&obligation)
})
}