Skip to content

Commit f07f0e9

Browse files
committed
WIP
1 parent 84e45e0 commit f07f0e9

File tree

1 file changed

+4
-2
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+4
-2
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
10011001
&mut self,
10021002
t: ty::Binder<'tcx, T>,
10031003
) -> ty::Binder<'tcx, T> {
1004-
if !t.has_placeholders() && !t.has_infer_regions() {
1004+
if !t.has_placeholders() && !t.has_infer() {
10051005
return t;
10061006
}
10071007
self.current_index.shift_in(1);
@@ -1048,6 +1048,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
10481048
}
10491049

10501050
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
1051+
let ty = self.infcx.shallow_resolve(ty);
10511052
match *ty.kind() {
10521053
ty::Placeholder(p) => {
10531054
let replace_var = self.mapped_types.get(&p);
@@ -1067,12 +1068,13 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
10671068
}
10681069
}
10691070

1070-
_ if ty.has_placeholders() || ty.has_infer_regions() => ty.super_fold_with(self),
1071+
_ if ty.has_placeholders() || ty.has_infer() => ty.super_fold_with(self),
10711072
_ => ty,
10721073
}
10731074
}
10741075

10751076
fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> {
1077+
let ct = self.infcx.shallow_resolve(ct);
10761078
if let ty::ConstKind::Placeholder(p) = ct.kind() {
10771079
let replace_var = self.mapped_consts.get(&p);
10781080
match replace_var {

0 commit comments

Comments
 (0)