1
Fork 0

Use Binder<Vec<T>> instead of Vec<Binder<T>> in new solver

This commit is contained in:
Michael Goulet 2025-02-26 17:32:26 +00:00
parent 4ecd70ddd1
commit 8282181e42
8 changed files with 70 additions and 75 deletions

View file

@ -2,6 +2,7 @@
//! the end of the file for details.
use rustc_middle::ty::fold::FnMutDelegate;
use rustc_middle::ty::visit::TypeVisitableExt;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable};
use tracing::{debug, instrument};
@ -26,8 +27,9 @@ impl<'tcx> InferCtxt<'tcx> {
where
T: TypeFoldable<TyCtxt<'tcx>>,
{
if let Some(inner) = binder.clone().no_bound_vars() {
return inner;
// Inlined `no_bound_vars`.
if !binder.as_ref().skip_binder().has_escaping_bound_vars() {
return binder.skip_binder();
}
let next_universe = self.create_next_universe();