1
Fork 0

instantiate canonical vars eagerly

This commit is contained in:
lcnr 2023-01-17 10:21:30 +01:00
parent b738b06160
commit bf7dbff921
11 changed files with 509 additions and 496 deletions

View file

@ -1106,17 +1106,6 @@ impl<'tcx, T> Binder<'tcx, T> {
if self.0.has_escaping_bound_vars() { None } else { Some(self.skip_binder()) }
}
pub fn no_bound_vars_ignoring_escaping(self, tcx: TyCtxt<'tcx>) -> Option<T>
where
T: TypeFoldable<'tcx>,
{
if !self.0.has_escaping_bound_vars() {
Some(self.skip_binder())
} else {
self.0.try_fold_with(&mut SkipBindersAt { index: ty::INNERMOST, tcx }).ok()
}
}
/// Splits the contents into two things that share the same binder
/// level as the original, returning two distinct binders.
///