1
Fork 0

Auto merge of #123537 - compiler-errors:shallow, r=lcnr

Simplify shallow resolver to just fold ty/consts

Probably faster than using a whole folder?
This commit is contained in:
bors 2024-04-16 21:59:36 +00:00
commit 3fba278231
13 changed files with 96 additions and 125 deletions

View file

@ -1173,8 +1173,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
return;
}
let self_ty = self.infcx.shallow_resolve(obligation.self_ty());
match self_ty.skip_binder().kind() {
let self_ty = self.infcx.shallow_resolve(obligation.self_ty().skip_binder());
match self_ty.kind() {
ty::Alias(..)
| ty::Dynamic(..)
| ty::Error(_)
@ -1325,7 +1325,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
obligation: &PolyTraitObligation<'tcx>,
candidates: &mut SelectionCandidateSet<'tcx>,
) {
let self_ty = self.infcx.shallow_resolve(obligation.self_ty());
let self_ty = self.infcx.resolve_vars_if_possible(obligation.self_ty());
match self_ty.skip_binder().kind() {
ty::FnPtr(_) => candidates.vec.push(BuiltinCandidate { has_nested: false }),