mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-13 18:37:33 +00:00
Rename At::normalize to At::query_normalize
This commit is contained in:
parent
8a09420ac4
commit
f12e772b83
@ -1933,7 +1933,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||||||
let infcx = self.tcx.infer_ctxt().build();
|
let infcx = self.tcx.infer_ctxt().build();
|
||||||
infcx
|
infcx
|
||||||
.at(&ObligationCause::dummy(), ty::ParamEnv::empty())
|
.at(&ObligationCause::dummy(), ty::ParamEnv::empty())
|
||||||
.normalize(candidate)
|
.query_normalize(candidate)
|
||||||
.map_or(candidate, |normalized| normalized.value)
|
.map_or(candidate, |normalized| normalized.value)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ use super::NoSolution;
|
|||||||
pub use rustc_middle::traits::query::NormalizationResult;
|
pub use rustc_middle::traits::query::NormalizationResult;
|
||||||
|
|
||||||
pub trait AtExt<'tcx> {
|
pub trait AtExt<'tcx> {
|
||||||
fn normalize<T>(&self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
|
fn query_normalize<T>(&self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
|
||||||
where
|
where
|
||||||
T: TypeFoldable<'tcx>;
|
T: TypeFoldable<'tcx>;
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ impl<'cx, 'tcx> AtExt<'tcx> for At<'cx, 'tcx> {
|
|||||||
/// normalizing, but for now should be used only when we actually
|
/// normalizing, but for now should be used only when we actually
|
||||||
/// know that normalization will succeed, since error reporting
|
/// know that normalization will succeed, since error reporting
|
||||||
/// and other details are still "under development".
|
/// and other details are still "under development".
|
||||||
fn normalize<T>(&self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
|
fn query_normalize<T>(&self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
|
||||||
where
|
where
|
||||||
T: TypeFoldable<'tcx>,
|
T: TypeFoldable<'tcx>,
|
||||||
{
|
{
|
||||||
|
@ -100,7 +100,7 @@ fn dropck_outlives<'tcx>(
|
|||||||
// to push them onto the stack to be expanded.
|
// to push them onto the stack to be expanded.
|
||||||
for ty in constraints.dtorck_types.drain(..) {
|
for ty in constraints.dtorck_types.drain(..) {
|
||||||
let Normalized { value: ty, obligations } =
|
let Normalized { value: ty, obligations } =
|
||||||
ocx.infcx.at(&cause, param_env).normalize(ty)?;
|
ocx.infcx.at(&cause, param_env).query_normalize(ty)?;
|
||||||
ocx.register_obligations(obligations);
|
ocx.register_obligations(obligations);
|
||||||
|
|
||||||
debug!("dropck_outlives: ty from dtorck_types = {:?}", ty);
|
debug!("dropck_outlives: ty from dtorck_types = {:?}", ty);
|
||||||
|
@ -29,7 +29,7 @@ fn try_normalize_after_erasing_regions<'tcx, T: TypeFoldable<'tcx> + PartialEq +
|
|||||||
let ParamEnvAnd { param_env, value } = goal;
|
let ParamEnvAnd { param_env, value } = goal;
|
||||||
let infcx = tcx.infer_ctxt().build();
|
let infcx = tcx.infer_ctxt().build();
|
||||||
let cause = ObligationCause::dummy();
|
let cause = ObligationCause::dummy();
|
||||||
match infcx.at(&cause, param_env).normalize(value) {
|
match infcx.at(&cause, param_env).query_normalize(value) {
|
||||||
Ok(Normalized { value: normalized_value, obligations: normalized_obligations }) => {
|
Ok(Normalized { value: normalized_value, obligations: normalized_obligations }) => {
|
||||||
// We don't care about the `obligations`; they are
|
// We don't care about the `obligations`; they are
|
||||||
// always only region relations, and we are about to
|
// always only region relations, and we are about to
|
||||||
|
@ -137,7 +137,7 @@ where
|
|||||||
{
|
{
|
||||||
let (param_env, Normalize { value }) = key.into_parts();
|
let (param_env, Normalize { value }) = key.into_parts();
|
||||||
let Normalized { value, obligations } =
|
let Normalized { value, obligations } =
|
||||||
ocx.infcx.at(&ObligationCause::dummy(), param_env).normalize(value)?;
|
ocx.infcx.at(&ObligationCause::dummy(), param_env).query_normalize(value)?;
|
||||||
ocx.register_obligations(obligations);
|
ocx.register_obligations(obligations);
|
||||||
Ok(value)
|
Ok(value)
|
||||||
}
|
}
|
||||||
|
@ -1588,7 +1588,7 @@ fn normalize<'tcx>(cx: &mut DocContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>>
|
|||||||
let infcx = cx.tcx.infer_ctxt().build();
|
let infcx = cx.tcx.infer_ctxt().build();
|
||||||
let normalized = infcx
|
let normalized = infcx
|
||||||
.at(&ObligationCause::dummy(), cx.param_env)
|
.at(&ObligationCause::dummy(), cx.param_env)
|
||||||
.normalize(ty)
|
.query_normalize(ty)
|
||||||
.map(|resolved| infcx.resolve_vars_if_possible(resolved.value));
|
.map(|resolved| infcx.resolve_vars_if_possible(resolved.value));
|
||||||
match normalized {
|
match normalized {
|
||||||
Ok(normalized_value) => {
|
Ok(normalized_value) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user