Allow escaping bound vars during normalize_erasing_regions in new solver
This commit is contained in:
@@ -37,7 +37,7 @@ pub use eval_ctxt::{
|
||||
EvalCtxt, GenerateProofTree, InferCtxtEvalExt, InferCtxtSelectExt, UseGlobalCache,
|
||||
};
|
||||
pub use fulfill::FulfillmentCtxt;
|
||||
pub(crate) use normalize::deeply_normalize;
|
||||
pub(crate) use normalize::{deeply_normalize, deeply_normalize_with_skipped_universes};
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
enum SolverMode {
|
||||
|
||||
@@ -19,9 +19,19 @@ use super::FulfillmentCtxt;
|
||||
pub(crate) fn deeply_normalize<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
|
||||
at: At<'_, 'tcx>,
|
||||
value: T,
|
||||
) -> Result<T, Vec<FulfillmentError<'tcx>>> {
|
||||
deeply_normalize_with_skipped_universes(at, value, vec![])
|
||||
}
|
||||
|
||||
/// Deeply normalize all aliases in `value`. This does not handle inference and expects
|
||||
/// its input to be already fully resolved.
|
||||
pub(crate) fn deeply_normalize_with_skipped_universes<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
|
||||
at: At<'_, 'tcx>,
|
||||
value: T,
|
||||
universes: Vec<Option<UniverseIndex>>,
|
||||
) -> Result<T, Vec<FulfillmentError<'tcx>>> {
|
||||
let fulfill_cx = FulfillmentCtxt::new(at.infcx);
|
||||
let mut folder = NormalizationFolder { at, fulfill_cx, depth: 0, universes: Vec::new() };
|
||||
let mut folder = NormalizationFolder { at, fulfill_cx, depth: 0, universes };
|
||||
|
||||
value.try_fold_with(&mut folder)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user